fork download
  1. #include <stdio.h>
  2. typedef void (*FuncPtr)(int);
  3.  
  4. void f1(int v) {
  5. printf("f1 with %d\n", v);
  6. }
  7.  
  8. void f2(int v) {
  9. printf("f2 with %d\n", v);
  10. }
  11.  
  12. FuncPtr FuncPtrArray[2] = {f1, f2};
  13. int main()
  14. {
  15. FuncPtrArray[0](0);
  16. FuncPtrArray[1](0);
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
f1 with 0
f2 with 0