1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#include <stdio.h> static void blah(int i) { printf("Hello, World! %d\n", i); } typedef void (*fn_ptr)(void); static fn_ptr get_blah(void) { return &blah; } int main() { void (*my_fn)(int) = NULL; my_fn = get_blah(); my_fn(10); return 0; }
1
Hello, World! 10