11.6 Wrap-Up
This chapter introduced inheritance—the ability to create a class by absorbing an existing class’s data members and member functions and embellishing them with new capabilities. Through a series of examples using an employee inheritance hierarchy, you learned the notions of base classes and derived classes and used public
inheritance to create a derived class that inherits members from a base class. The chapter introduced the access specifier protected
—derived-class member functions can access protected
base-class members. You learned how to access redefined base-class members by qualifying their names with the base-class name and scope resolution operator (::
). You also saw the order in which constructors and destructors are called ...
Get C++ How to Program, 10/e 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.