0
what does DAUGHTER M mean or do in the main code?
#include <iostream> using namespace std; class Mother { public: Mother() { cout <<"Mother ctor"<<endl; } ~Mother() { cout <<"Mother dtor"<<endl; } }; class Daughter: public Mother { public: Daughter() { cout <<"Daughter ctor"<<endl; } ~Daughter() { cout <<"Daughter dtor"<<endl; } }; int main() { Daughter m; }
2 ответов
+ 1
You are calling Daughter class with a object m as a reference of Daughter class, Daughter class is derived from mother class
0
Thank you