fork download
  1.  
  2.  
  3.  
  4. class A
  5. {public:
  6. A(int x, float y=0){}
  7. A(int x , char y){}
  8.  
  9. };
  10.  
  11.  
  12. int main()
  13. {
  14. A ob(2,2);
  15.  
  16. return 0;
  17. }
Compilation error #stdin compilation error #stdout 0s 3092KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:14:11: error: call of overloaded 'A(int, int)' is ambiguous
   A ob(2,2);
           ^
prog.cpp:14:11: note: candidates are:
prog.cpp:7:2: note: A::A(int, char)
  A(int x , char y){} 
  ^
prog.cpp:6:2: note: A::A(int, float)
  A(int x, float y=0){} 
  ^
stdout
Standard output is empty