A member of the class can be: private protected public
1. If a member is private, its name can only be used by the member functions and Friends of the class in which it is declared
2. If a member is protected, its name can only be used by the member functions and Friends of the class in which it is declared, and by the member functions and Friends of the derived classes of this class.
3. If a member is public, its name can be used by any function.
Public protected private)
The access descriptor of the base class controls the access to the base class members, as well as the pointer and reference conversion from the derived class type to the base class type. Consider deriving Class D from base class B
1. If B is a private base class, its public and protected members can only be accessed by member functions and friends of D.
Only members and friends of D can convert D * to B *
2. If B is a protected base class, its public and protected members can only be accessed by member functions and friends of D, as well as member functions and Friends of the class derived from D. Only the members and supporting elements of D and the members and friendly elements of the class derived from D can convert D * to B *
3. If B is a public base class, its public member can be used by any function. In addition, its protected members can be accessed by member functions and friends of D, as well as member functions and friends of classes derived from D. Any function can convert D * to B *