#include <iostream>
struct Parent
{
Parent ( int = 10 ) { std::cout << "Parent(int) " ; }
Parent ( const Parent & ) { std::cout << "Parent(const Parent&) " ; }
} ;
struct Child : Parent
{
Child ( ) { std::cout << "Child() " ; }
Child ( const Child& ) { std::cout << "Child(const Child&) " ; }
} ;
int main ()
{
Child obj1 ;
Child obj2(obj1) ;
}
Parent(int) Child() Parent(const Parent&) Child(const Child&)
Parent(int) Child() Parent(int) Child(const Child&)
Произойдет ошибка компиляции, потому что не определен default конструктор для класса Parent