Chapter 12. CLASS INHERITANCE

You will learn about the following in this chapter:

  • Inheritance as an is-a relationship

  • How to publicly derive one class from another

  • Protected access

  • Constructor initializer lists

  • Upcasting and downcasting

  • Virtual member functions

  • Early (static) binding and late (dynamic) binding

  • Pure virtual functions

  • When and how to use public inheritance

One of the main goals of object-oriented programming is providing reusable code. When you develop a new project, particularly if the project is large, it's nice to be able to reuse proven code rather than to reinvent it. Employing old code saves time and, because it has already been used and tested, can help suppress the introduction of bugs into a program. Also, the less you have to ...

Get The Waite Group's C++ Primer Plus, Third Edition 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.