summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--funcptrptr.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/funcptrptr.c b/funcptrptr.c
index 810764e..17864a0 100644
--- a/funcptrptr.c
+++ b/funcptrptr.c
@@ -22,23 +22,20 @@ int half(int i) {
void fpv_exec(int (**fpv)(int), int n) {
int i;
- for (i = 0; *(fpv + i) != NULL; i++) {
+ for (i = 0; *(fpv + i) != NULL; i++)
printf("%d\n", (*(fpv + i))(n));
- }
}
void fpvv_exec(int (***fpvv)(int), int n) {
int i;
- for (i = 0; *(fpvv + i) != NULL; i++) {
+ for (i = 0; *(fpvv + i) != NULL; i++)
fpv_exec(*(fpvv + i), n);
- }
}
void fpvvv_exec(int (****fpvvv)(int), int n) {
int i;
- for (i = 0; *(fpvvv + i) != NULL; i++) {
+ for (i = 0; *(fpvvv + i) != NULL; i++)
fpvv_exec(*(fpvvv + i), n);
- }
}
int main(int argc, char **argv) {
@@ -70,9 +67,8 @@ int main(int argc, char **argv) {
fpvvv[1][1][2] = half;
fpvvv[1][1][3] = NULL;
- for (argv++, argc--; argc; argv++, argc--) {
+ for (argv++, argc--; argc; argv++, argc--)
fpvvv_exec(fpvvv, atoi(*argv));
- }
exit(EXIT_SUCCESS);
}