O'Reilly logo

Sams Teach Yourself C++ in 24 Hours, Third Edition by Jesse Liberty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required