O'Reilly logo

SAMS Teach Yourself C++ in 10 Minutes SECOND 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

Overriding Functions

As you've seen, a derived class can override the functions of its superclass. Member functions of the derived class can even call the functions of the superclass—including those implementations they are overriding. Figure 22.3 shows the possible variations.

Figure 22.3. Calls to functions in a derived class.

This diagram shows an object instance, which consists of the derived class and its superclass. When a function outside the object calls on SomeFunction(), the call is handled completely by the derived class and is not passed on to the corresponding superclass implementation. When a function outside the object calls on ...

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