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. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access