Accessing Base and Derived Class Services

Normally, a derived class "is a" base class; each object of the derived class has all base class data and function members plus added and redefined data and methods.

In a sense, the derived class is a client of the base class, very much as any C++ code is a client of its server classes. The client code uses the server services: data members and member functions. The server class does not know about its client classes. It does not know even the name of its clients. This is natural because the server class or function might be from a library, written perhaps years before the client code was. The client class must know the name of its server classes and the names of its public services to be able to use ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.