fork download
  1. #include <iostream>
  2.  
  3. using namespace std; // haters gonna hate
  4.  
  5. typedef char * charPtr;
  6.  
  7. typedef float (*crazyFunction)(float(*)(), float);
  8.  
  9. float bar()
  10. {
  11. return 3.1415926535;
  12. }
  13.  
  14. float foo(float(*func)(), float argument)
  15. {
  16. return func() + argument;
  17. }
  18.  
  19. int main()
  20. {
  21. char * c1, c2, c3;
  22. c1 = NULL;
  23. c2 = 'a';
  24. c3 = c2;
  25.  
  26. charPtr x1, x2, x3;
  27. x1 = NULL;
  28. x2 = x1;
  29. x3 = x1;
  30.  
  31. float (*someCrazyFunction)(float(*)(), float) = foo; // WTF is this
  32.  
  33. crazyFunction myCrazyFunction = foo; // easier to deal with
  34.  
  35. cout << someCrazyFunction(bar, 1) << " " << myCrazyFunction(bar, 2) << endl;
  36. return 0;
  37. }
Success #stdin #stdout 0.01s 2680KB
stdin
Standard input is empty
stdout
4.14159 5.14159