fork download
  1. #include<iostream>
  2.  
  3. int func ()
  4. {
  5. std::cout << "foo()\n";
  6. return 0;
  7. }
  8.  
  9. void foo1 (int (*pf)()) { pf(); }
  10. void foo2 (int (pf)()) { pf(); }
  11. void foo3 (int pf()) { pf(); }
  12.  
  13. int main ()
  14. {
  15. foo1(func);
  16. foo2(func);
  17. foo3(func);
  18. }
  19.  
Success #stdin #stdout 0s 2852KB
stdin
Standard input is empty
stdout
foo()
foo()
foo()