class B { public: B() { a = new int[10]; } ~B() { delete[] a; } private: int *a; }; class A { public: A(B& b): m_b(b) {} private: B *m_b; };
1 2 10 42 11
prog.cpp: In constructor 'A::A(B&)': prog.cpp:15: error: cannot convert 'B' to 'B*' in initialization
Standard output is empty