fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. typedef rec (*rec)(void);
  5.  
  6. rec func(void){
  7. return &func;
  8. }
  9.  
  10. int main() {
  11.  
  12. return 0;
  13. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:4:13: error: ISO C++ forbids declaration of ‘rec’ with no type [-fpermissive]
 typedef rec (*rec)(void);
             ^
prog.cpp:4:13: error: typedef ‘rec’ is initialized (use decltype instead)
prog.cpp:4:15: error: ‘rec’ was not declared in this scope
 typedef rec (*rec)(void);
               ^~~
prog.cpp:6:1: error: ‘rec’ does not name a type
 rec func(void){
 ^~~
stdout
Standard output is empty