Summing Up

Inheritance is a very powerful but abstract feature. It primarily benefits programmers of larger systems that will evolve over time. As you have seen throughout this book, system enhancement, repair, and refactoring represent some of the most important activities programmers perform, far outweighing the time and effort spent on new programs and systems. So inheritance has a critical part to play in reducing the risk of introducing errors during maintenance and minimizing the effort needed to add new features.

You have seen how to create a derived class from a superclass, and how a reference to a superclass can end up with a call to derived class functions through the use of virtual (a feature called class polymorphism). You have learned ...

Get SAMS Teach Yourself C++ in 10 Minutes SECOND EDITION now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.