fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class A {
  5. int a;
  6. public:
  7. A( int inputA ) { a = inputA; }
  8. A(A that) { a = that.a; }
  9. };
  10.  
  11. class B {
  12. A objectA;
  13. public:
  14. B( A inputObjectA ): objectA(inputObjectA) { }
  15. };
  16.  
  17.  
  18. int main() {
  19. // your code goes here
  20. return 0;
  21. }
Compilation error #stdin compilation error #stdout 0s 3292KB
stdin
Standard input is empty
compilation info
prog.cpp:8:13: error: invalid constructor; you probably meant ‘A (const A&)’
     A(A that) { a = that.a; }
             ^
stdout
Standard output is empty