}; Parent (void) { cout<<"~Parent()\n"; }; }; class Child1 :public Parent {}; class Child2 :public Parent { public: Child2 (void) { cout<<"Child2()\n"; } Child2 (inti): Parent (i) { cout<<"Child2("<<i<<")\n"; } ~Child2 (void) { cout<<"~Child2()\n"; } }; int main (void) { Child1 a; Child2 b; Child2 c(42); return0; } Parent() Parent() Child2() Parent(42) Child2(42) ~Child2() ~Parent()
}; Parent (void) { cout<<"~Parent()\n"; }; }; class Child1 :public Parent {}; class Child2 :public Parent { public: Child2 (void) { cout<<"Child2()\n"; } Child2 (inti): Parent (i) { cout<<"Child2("<<i<<")\n"; } ~Child2 (void) { cout<<"~Child2()\n"; } }; int main (void) { Child1 a; Child2 b; Child2 c(42); return0; } Parent() Parent() Child2() Parent(42) Child2(42) ~Child2() ~Parent()