Hi,
I have an interesting question about an object pointer.
If you have
Class A <---- Class B <--- Class C <- Class D
/
/
Class F <----- Class E <---
So A and F are base classes and B and E derive from them respectively and C derives from Both E and B. Then D derives from C.
int method foo(B * ptr pB)
{
D *pD= (D*)pB;
pD->methodgooOnCla ssF();
}
int main ()
{
D instaD;
// ...
// set and do stuff with foo.
foo ( (B*) &instaD);
}
So Now the question:
The object being passed around even though it is passed around by it's base class does not lose anything. It is still an object that contains the classes a-f correct? This is correct so long as a copy is not attempted, right?
Thanks in Advance