fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void foo(float) {cout << "float";}
  5. void foo(double) {cout << "double";}
  6. void foo(long double) {cout << "long double";}
  7.  
  8. int main() {
  9. foo(5)
  10. return 0;
  11. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:9:7: error: call of overloaded ‘foo(int)’ is ambiguous
  foo(5)
       ^
prog.cpp:9:7: note: candidates are:
prog.cpp:4:6: note: void foo(float)
 void foo(float) {cout << "float";}
      ^
prog.cpp:5:6: note: void foo(double)
 void foo(double) {cout << "double";}
      ^
prog.cpp:6:6: note: void foo(long double)
 void foo(long double) {cout << "long double";}
      ^
prog.cpp:10:2: error: expected ‘;’ before ‘return’
  return 0;
  ^
stdout
Standard output is empty