f



why can't derived class pointer can't point to base class object #2

Dear All,
According to OOPs , a base class pointer can to point to derived class
object....call this as fact1
But somehow I am not comfortable while understanding this concept.
The explanaition to the fact1 is given as since the derived object
always consists of the base part , the base class pointer will always
point to the base part in the derived object unless otherwise the
function in the base class are declared as virtual and are overrided in
the derived class.
My confusion is, since the derived class always consists of the base
class part in it,it should be more logical to think that the pointer to
the derived class can store the address of the base class object as it
will be always carrying the base class related services and data with
it.
This confusion gives me lot of headech while studying the COM and other
advanced concept . will someone please give me any good explaination or
justification of where my thinking process is going wrong(straying??)?.
I will be very grateful to him..

regds,
Yogesh Joshi

0
12/24/2004 6:34:36 AM
comp.lang.c++ 49423 articles. 7 followers. Post Follow

0 Replies
632 Views

Similar Articles

[PageSpeed] 12

Reply: