summaryrefslogtreecommitdiff
path: root/funcptr.c
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-12-10 15:33:04 +1300
committerTom Ryder <tom@sanctum.geek.nz>2019-12-10 15:33:04 +1300
commit2fbe9ae5cc204bd620c3755e7723d79efde5062a (patch)
tree0410fb2c22ab6b0ce81c831be479b4917d8997fe /funcptr.c
parentAdd length to arrays (diff)
downloadfuncptr-2fbe9ae5cc204bd620c3755e7723d79efde5062a.tar.gz
funcptr-2fbe9ae5cc204bd620c3755e7723d79efde5062a.zip
Switch spaces to tabs
Diffstat (limited to 'funcptr.c')
-rw-r--r--funcptr.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/funcptr.c b/funcptr.c
index dc4aaf3..9bf33c2 100644
--- a/funcptr.c
+++ b/funcptr.c
@@ -8,26 +8,26 @@ static int (*fpv[4])(int);
void fpv_exec(int (**)(int), int);
int doub(int i) {
- return i * 2;
+ return i * 2;
}
int trip(int i) {
- return i * 3;
+ return i * 3;
}
int half(int i) {
- return i / 2;
+ return i / 2;
}
static int (*fpv[4])(int) = {doub, trip, half, NULL};
void fpv_exec(int (**fpv)(int), int n) {
- while (*fpv)
- printf("%d\n", (*fpv++)(n));
+ while (*fpv)
+ printf("%d\n", (*fpv++)(n));
}
int main(int argc, char **argv) {
- for (argv++, argc--; argc; argv++, argc--)
- fpv_exec(fpv, atoi(*argv));
- exit(EXIT_SUCCESS);
+ for (argv++, argc--; argc; argv++, argc--)
+ fpv_exec(fpv, atoi(*argv));
+ exit(EXIT_SUCCESS);
}