Sep 21, 2013 at 4:47am
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 Sep 21, 2013 at 6:36pm
Sep 22, 2013 at 9:55am
if we print value of p it will print 00cofefc on console
if we print value of s it will print 00coff00 on console !
Sep 22, 2013 at 11:11am
Yes, but what does that mean? Btw, what was the T in your test?
Last edited on Sep 22, 2013 at 11:12am
Sep 22, 2013 at 11:35am
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) !