fork download
  1. #include <vector>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. void f(int a, int b)
  7. {
  8. cout << "a = " << a << " b = " << b << endl;
  9. }
  10.  
  11. int main(void)
  12. {
  13. vector<void(*)(int, int)> fun;
  14. fun.push_back(f);
  15. fun[0](1, 2);
  16. }
Success #stdin #stdout 0s 3028KB
stdin
Standard input is empty
stdout
a = 1 b = 2