Hour 17. Polymorphism and Derived Classes

In the previous hour, you learned about inheritance and how derived classes can create an inheritance hierarchy. You also saw how methods in the base class can be overridden in the derived class. In this hour, you will learn how virtual methods enable you to use your base classes polymorphically. The following topics are covered:

  • What virtual methods are

  • How to use virtual destructors and copy constructors

  • The costs and dangers in using virtual methods

Get Sams Teach Yourself C++ in 24 Hours, 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.