Castor Tack wrote:Many thanks to both of you.
I think I'm clear now.
And for the extended question, I did an experiment. Everything the son class inherits from father is within his own domain, i.e. when son is created, a deep copy (instead of shallow copy) of all data members in father is created.
In fact, there is no copy of data from the Father to the Son. When you do:
There is only one single Object (the son), not two distinct Objects (a Father and a Son). I think whatever
test you used to determine if it is a deep or shallow copy was flawed. If you show the code you used, then maybe we can indicate where the misconception is.