fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. typedef void(*void_func)();
  5. typedef void_func (*func_type) (int);
  6. void_func arbitraryFunction(int a) {
  7. // could be this function, or another with the same signature,
  8. cout << "arbitraryFunction\n";
  9. return nullptr;
  10. }
  11. void_func function(int a) {
  12. // could be this function, or another with the same signature,
  13. return (void_func) arbitraryFunction;
  14. }
  15. int main() {
  16. // your code goes here
  17. func_type f = (func_type) function(0);
  18. f(0);
  19. return 0;
  20. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
arbitraryFunction