// A2_10.cpp #include using namespace std; class X { }; class C { public: // note: commenting out either of these member functions // results in a failure to compile C() { cout << "\n C::C() called"; } C(const C &c) { cout << "\n C::C(const C &c) called"; } C(const X &x) { cout << "\n C::C(const X &x) called"; } }; void main() { X x; C c[3] = { x }; // A2 #10 corrected in class // initialize with instance, not class type // Note that promotion ctor called for c[0] and void ctor // called for c[1] and c[2]. Also note that the copy ctor // is not called. cout << "\n\n"; }