classClock { private: int h; int m; int s; public: Clock() { cout<<"Clock's constructor called"<<endl; } Clock(int h,int m,int s) { cout<<"Clock's consturctor with paramter called !"<<endl; } };
classAlarmClock:public Clock { private: int ah; int am; int as; public: AlarmClock() { cout<<"AlarmClock's constructor called!"<<endl; } AlarmClock(int h,int m,int s):Clock(h,m,s) { cout<<"AlarmClock's constructor with paramter called!"<<endl; }
classClock { private: int h; int m; int s; public: Clock() { cout<<"Clock's consturctor called !"<<endl; } ~Clock() { cout<<"Clock's destructor called !"<<endl; } };
classAlarmClock:public Clock { private: int ah; int am; int as; public: AlarmClock() { cout<<"AlarmClock's constructor called !"<<endl; } ~AlarmClock() { cout<<"AlarmClock's destructor called !"<<endl; } };