fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int func()
  5. {
  6. return 2;
  7. }
  8.  
  9. int main() {
  10. int (*foo)();
  11. foo = func;
  12. cout << (*foo)();
  13. return 0;
  14. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
2