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; }

15th Nov 2016, 11:43 AM
Faminan Tioro
Faminan Tioro - avatar
2 Réponses
+ 1
You are calling Daughter class with a object m as a reference of Daughter class, Daughter class is derived from mother class
15th Nov 2016, 11:45 AM
Aditya kumar pandey
Aditya kumar pandey - avatar
0
Thank you
15th Nov 2016, 1:14 PM
Faminan Tioro
Faminan Tioro - avatar