### Derivation Access of Base Classes

When you declare a derived class, an access specifier can precede each base class in the base list of the derived class. This does not alter the access attributes of the individual members of a base class as seen by the base class, but allows the derived class to restore the access attributes of the members of a base class.

You can derive classes using any of the three access specifiers:

- In a public base class, public and protected members of the base class remain public and protected members of the derived class.
- In a private base class, public and protected members of the base class become private members of the derived class.
- In a protected base class, public and protected members of the base class are protected members of the derived class.

In all cases, private members of the base class remain private. Private members of the base class cannot be used by the derived class unless friend declarations within the base class explicitly grant access to them.

You can use both a structure and a class as base classes in the base list of a derived class declaration. If the base class is declared with the keyword class, its default access specifier in the base list of a derived class is private. If the base class is declared with the keyword struct, its default access specifier in the base list of a derived class is public.

Members and friends of a class can implicitly convert a pointer to an object of that class to a pointer to either:

- A direct private base class
- A protected base class (either direct or indirect)

Access Declarations
Access Resolution
Member Access
Derivation

Examples of Public and Private Derivation