fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class X1
  5. {
  6. X1(int arg_value1) : value1(arg_value1) {}
  7. int value1;
  8. };
  9.  
  10. class X2 : public X1
  11. {
  12. int value2;
  13. };
  14.  
  15. int main()
  16. {
  17. X2 exampleClass;
  18. return 0;
  19. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In constructor ‘X2::X2()’:
prog.cpp:11: error: no matching function for call to ‘X1::X1()’
prog.cpp:6: note: candidates are: X1::X1(int)
prog.cpp:5: note:                 X1::X1(const X1&)
prog.cpp: In function ‘int main()’:
prog.cpp:17: note: synthesized method ‘X2::X2()’ first required here 
stdout
Standard output is empty