fork(1) download
  1. #include<iostream>
  2. using namespace std;
  3. class abc{
  4. int a;
  5. public: abc() { } //do nothing constructor
  6. abc(int x=6){ a=x;} //constructor with default argument
  7. };
  8. main()
  9. {
  10. abc a;
  11. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:8:7: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
prog.cpp: In function ‘int main()’:
prog.cpp:10:11: error: call of overloaded ‘abc()’ is ambiguous
prog.cpp:10:11: note: candidates are:
prog.cpp:6:12: note: abc::abc(int)
prog.cpp:5:12: note: abc::abc()
stdout
Standard output is empty