fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void f1() { cout << "f1" << endl; }
  6. void f2() { cout << "f2" << endl; }
  7.  
  8. void (*fs[])() = { f1, f2 };
  9.  
  10. int main()
  11. {
  12. for (int q=0; q<2; ++q)
  13. fs[q]();
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
f1
f2