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 .

Reprint please indicate the source :http://blog.csdn.net/elfprincexu

First of all :private、public、protected The scope of the visit .

};  
              {  
                  b=privatedateA;       };  
              {  
                  c=privatedateA;        };  
              {  
                  d=privatedateA;       };  
   {  
         
     B objB;  
     a=objB.privatedateA;           C objC;  
     a=objC.privatedateA;           D objD;  
     a=objD.privatedateA;           ;