Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void one();
- void two();
- void three();
- void four();
- int main()
- {
- void(*func[4])();
- func[0] = one;
- func[1] = two;
- func[2] = three;
- func[3] = four;
- for (int i = 0; i < 4; i++)
- func[i]();
- return 0;
- }
- void one()
- {
- cout << "Hello From One" << endl;
- }
- void two()
- {
- cout << "Hello From Two" << endl;
- }
- void three()
- {
- cout << "Hello From Three" << endl;
- }
- void four()
- {
- cout << "Hello From Four" << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement