The inheritance methods in C + + are:
Public, private, protected three (they directly affect the members of the derived class, and the rules that their objects access to the base class members).
(1) Public: Inheritance keeps the properties of the members in the base class intact, and the private members in the base class are hidden.
members of derived classesYou can access only public/protected members in the base class, not private members;object of the derived classOnly public members in the base class can be accessed.
(2) Private (private inheritance): The member properties in the inheritance base class are changed to private, and the private members are hidden.
members of derived classesYou can access only the public/protected members in the base class, but not the private members; object of the derived class You cannot access any of the members in the base class.  
(3) protected (Protective inheritance): Each member property in the inheritance base class is changed to protected, and the private member is hidden.
members of derived classes can access only public/protected members in the base class, not private members; object of the derived class You cannot access any of the members in the base class.
C + + public inheritance, protection inheritance, and private inheritance