Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. void fun1()
  2. {
  3.  
  4. }
  5.  
  6. void fun2()
  7. {
  8.  
  9. }
  10.  
  11. void fun3()
  12. {
  13.  
  14. }
  15.  
  16. void (*func_ptr[3]) = {fun1, fun2, fun3};
  17.  
  18. main()
  19. {
  20. int option;
  21.  
  22.  
  23. printf("\nEnter function number you want");
  24. printf("\nYou should not enter other than 0 , 1, 2"); /* because we have only 3 functions */
  25. scanf("%d",&option);
  26.  
  27. if((option>=0)&&(option<=2))
  28. {
  29. (*func_ptr[option])();
  30. }
  31.  
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement