Contact: aviboots(AT)netvision.net.il
41,163 questions
53,655 answers
573 users
#include <stdio.h> void f(void (*p)()) { p(); } void example() { printf("C Programming\n"); } int main() { f(&example); return 0; } /* run: example */
#include <stdio.h> typedef int (*FUNC_PTR)(int, float); void f(FUNC_PTR fptr) { fptr(283, 3.14); } int example(int n, float f) { printf("%f", n * f); } int main() { FUNC_PTR fptr; fptr = example; f(fptr); return 0; } /* run: 888.620056 */