fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. typedef double FctValue;
  5. typedef FctValue (*Fct)(FctValue a); // Funktionen f(x)
  6.  
  7. struct fct
  8. {
  9. const char *cFct;
  10. Fct _fct;
  11. };
  12.  
  13. double abc(const double&) { return 0; }
  14. float abc(float) { return 1; }
  15.  
  16. static fct aFct[] =
  17. {
  18. { "abc", abc },
  19. { NULL }
  20. };
  21.  
  22. int main() {
  23. // your code goes here
  24. return 0;
  25. }
Compilation error #stdin compilation error #stdout 0s 15240KB
stdin
Standard input is empty
compilation info
prog.cpp:20:1: error: no matches converting function ‘abc’ to type ‘Fct {aka double (*)(double)}’
 };
 ^
prog.cpp:14:7: note: candidates are: float abc(float)
 float abc(float) { return 1; }
       ^~~
prog.cpp:13:8: note:                 double abc(const double&)
 double abc(const double&) { return 0; }
        ^~~
stdout
Standard output is empty