8. Class Inheritance

Now that you know how to create simple classes, you’re ready to learn one of the most important features of C++: inheritance. Inheritance is a core concept in object-oriented programming, revolutionizing the way software is modeled. Inheritance lets you build hierarchies of classes, each class inheriting methods and attributes from its base class. Because classes inherit members from the base class, those members can be used as if you had an object of that base class available. In short, inheritance allows you to expand upon existing, solid code so that it can be adopted for new applications. But don’t worry, it’s easier than it sounds, and we’ll take you through it gently.

In this chapter, we’ll introduce you to the basics ...

Get C++ Programming: Visual QuickStart Guide 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.