why we don't make pointer of child/derived class which points/assigns to base class object?
for example:
1 2 3 4
|
parent a; // a is a parent class object!
child * p = & a; // p is child class pointer !
|
why we do not do this in c++ ?
Last edited on
if we print value of p it will print 00cofefc on console
if we print value of s it will print 00coff00 on console !
Yes, but what does that mean? Btw, what was the T in your test?
Last edited on
I am not very much familiar with hex numbers so i am not sure what that does mean !
you may explain this to me !
T is a class name/user defined data type (parent class) !