College life , It's about the scope of the class , Inheritance is all for use public Joint inheritance , I didn't think so much at that time , I think it's very convenient to inherit together , How simple , Anyway, there are not too many restrictions , Whether it's a member of a class or a member of a base class, functions can be accessed . Not in depth . In fact, it really involves C++ Encapsulation in object-oriented design . Expose only those members and member functions that are needed , You don't have to expose all the members too much .
First of all ：private、public、protected The scope of the visit .
a=objB.privatedateA; C objC;
a=objC.privatedateA; D objD;