fork download
  1. int fx()
  2. {
  3. //ff
  4. }
  5.  
  6. int* zwroc(int(*neptun)())
  7. {
  8. return neptun;
  9. }
  10.  
  11. int _tmain(int argc, _TCHAR* argv[])
  12. {
  13. zwroc(fx);
  14.  
  15.  
  16.  
  17. --------------------------------------------
  18.  
  19. void fx()
  20. {
  21. //ff
  22. }
  23.  
  24. void* zwroc(void(*neptun)())
  25. { //tu jest błąd
  26. return neptun; //return value type does not match the function type
  27. }
  28.  
  29. int _tmain(int argc, _TCHAR* argv[])
  30. {
  31. zwroc(fx);
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int* zwroc(int (*)())':
prog.cpp:8:9: error: cannot convert 'int (*)()' to 'int*' in return
  return neptun;
         ^
prog.cpp: At global scope:
prog.cpp:11:22: error: '_TCHAR' has not been declared
 int _tmain(int argc, _TCHAR* argv[])
                      ^
prog.cpp: In function 'int _tmain(int, int**)':
prog.cpp:19:1: error: expected primary-expression before 'void'
 void fx()
 ^
prog.cpp:25:1: error: a function-definition is not allowed here before '{' token
 {     //tu jest błąd
 ^
prog.cpp:29:22: error: '_TCHAR' has not been declared
 int _tmain(int argc, _TCHAR* argv[])
                      ^
prog.cpp:30:1: error: a function-definition is not allowed here before '{' token
 {
 ^
prog.cpp:31:11: error: expected '}' at end of input
  zwroc(fx);
           ^
stdout
Standard output is empty