fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int f(int a, int b, int c = 10)
  5. {
  6. return a + c;
  7. }
  8.  
  9. int f(int a, int b)
  10. {
  11. return b;
  12. }
  13.  
  14. int main() {
  15. f(10, 20);
  16. return 0;
  17. }
Compilation error #stdin compilation error #stdout 0s 4520KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:15:10: error: call of overloaded ‘f(int, int)’ is ambiguous
  f(10, 20);
          ^
prog.cpp:4:5: note: candidate: ‘int f(int, int, int)’
 int f(int a, int b, int c = 10)
     ^
prog.cpp:9:5: note: candidate: ‘int f(int, int)’
 int f(int a, int b)
     ^
stdout
Standard output is empty