I\'m writing some code involving inheritance from a basic ref-counting pointer class; and some intricacies of C++ popped up. I\'ve reduced it as follows:
Suppose I h
What you get is something like this in memory
----------
| A data |
----------
| B data |
----------
| C data |
----------
So if you want the entire C object you'll get a pointer to the beginning of the memory. If you want only the A "part", you get the same address since that's where the data members are located. If you want the B "part" you get the beginning + sizeof(A) + sizeof(whatever the compiler adds for vtable). Thus, in the example, pc != pb (could be pc != pa) but pa is never equal to pb.