Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. void f1(int var)
  4. {
  5. printf("this is f1 and var is: %d\n", var);
  6. }
  7.  
  8. void f2(int var)
  9. {
  10. printf("this is f2 and var is: %d\n", var);
  11. }
  12.  
  13. void f3(int var)
  14. {
  15. printf("this is f3 and var is: %d\n", var);
  16. }
  17.  
  18. int main()
  19. {
  20. void (*pf[])(int) = {f1, f2, f3};
  21.  
  22. int c = 0;
  23. while(c < 3)
  24. {
  25. pf[c](c);
  26. ++c;
  27. }
  28.  
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement