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

Virtual Member Functions

virtual should always be used on a function in the protected section. If you envision a public function being overridden, it should also get the virtual keyword.

Some programmers worry about the performance penalty of the indirect virtual function call. In truth, this is probably not a significant drag on typical program performance, compared to things such as file I/O or database access, or even the time it takes to type a character.

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