aboutsummaryrefslogtreecommitdiff
path: root/testbed/func_pointer.c
diff options
context:
space:
mode:
Diffstat (limited to 'testbed/func_pointer.c')
-rw-r--r--testbed/func_pointer.c19
1 files changed, 0 insertions, 19 deletions
diff --git a/testbed/func_pointer.c b/testbed/func_pointer.c
deleted file mode 100644
index e7b6484..0000000
--- a/testbed/func_pointer.c
+++ /dev/null
@@ -1,19 +0,0 @@
-typedef void (*Func_t)();
-void f(Func_t func, int step) {
- if (!step) return;
- printf("i'm f\n");
- func(func, step - 1);
-}
-void g(void (*func)(), int step) {
- if (!step) return;
- printf("i'm g\n");
- func(func, step - 1);
-}
-int main() {
- void (*func)(void (*ifunc)(), int step);
- int x = 1;
- if (x) func = f;
- else func = g;
- func(func, 5);
- return 0;
-}