Advertisement
Guest User

Untitled

a guest
Apr 30th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. void one();
  5. void two();
  6. void three();
  7. void four();
  8.  
  9.  
  10. int main()
  11. {
  12.     void(*func[4])();
  13.  
  14.     func[0] = one;
  15.     func[1] = two;
  16.     func[2] = three;
  17.     func[3] = four;
  18.  
  19.     for (int i = 0; i < 4; i++)
  20.         func[i]();
  21.    
  22.     return 0;
  23. }
  24.  
  25.  
  26.  
  27. void one()
  28. {
  29.     cout << "Hello From One" << endl;
  30. }
  31. void two()
  32. {
  33.     cout << "Hello From Two" << endl;
  34. }
  35. void three()
  36. {
  37.     cout << "Hello From Three" << endl;
  38. }
  39. void four()
  40. {
  41.     cout << "Hello From Four" << endl;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement