include <iostream.h>class B{ public: B(int i) { cout<<"constructing B "<<i<<endl; }};class C: public B{ public: C(int a, int b,int c):B(a),memberB(b) { cout<<"constructing C "<<c<<endl;}private: B memberB;};void main(){ C obj(1,2,3); }
include <iostream.h>class point { private:int x,y; public: point(int a=0,int b=0){ cout <<"A object is created"<<endl; } ~point(){ cout<<"A object is destroyed"<<endl; } };void main(){ point a1,a2,*p;p= new point;}