Accessing Base Components of a Derived Class Object

Now things become less intuitive and more convoluted. Members and friends of a derived class do receive access to all data members and member functions of this derived class. They also receive some access to data members and member functions of the base class. They have access to public and protected members only, not to private data members and member functions of the base class. They also do not receive access to members of other classes derived from the same base class.

One of the ways to look at this rule is that the base class has three kinds of clients (or three areas of access). In the inner area, with the greatest right to access data members and member functions, are class member functions ...

Get Core C++ A Software Engineering Approach now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.