Summary

In this chapter, we continued studying the relationships between C++ classes. The relationship of inheritance allows the use of one class as a base for another class. By virtue of doing so, the derived class inherits all data members and member functions of the base class. Usually, the derived class adds more data members and member functions to members inherited from the base class. Sometimes, the derived class redefines the capabilities inherited from the base class.

Using inheritance provides a great way to modularize the design. Instead of designing a server class in one leap, you can create and debug a base class and then add more functionality in the form of derived classes.

The use of inheritance facilitates program evolution. ...

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.