Is it possible to pass a function pointer as an argument to a function in C?
If so, how would I declare and define a function which takes a function pointer as an argument?
Definitely.
void f(void (*a)()) { a(); } void test() { printf("hello world "); } int main() { f(&test); return 0; }
1.4m articles
1.4m replys
5 comments
57.0k users