Yuan Peng Chiang thinks this is interesting: virtual void speak() const { std::cout << "Mammal speak!\n"; } From Hour 17. Using Polymorphism and Derived Classes from Sams Teach Yourself C++ in 24 Hours, fifth edition by Rogers Cadenhead, Jesse Liberty Publisher: Sams Released: April 2011 Note sub-classes has to override this function. without virtual, base class's function will be called Share this highlight http://www.safaribooksonline.com/a/sams-teach-yourself/74816/ Twitter Facebook Google Plus Email Get Instant Access Now Start a Free Trial Have an account? Sign in. Minimise Unlock the rest of Sams Teach Yourself C++ in 24 Hours, fifth edition and 30,000 other books and videos By clicking this box, you confirm that you have read and agree to the terms and conditions of our Membership Agreement, and you understand that when your trial period ends, you will be required to provide billing information if you wish to continue using the service. Unlock the rest of this book Start a Free 10-Day Trial loading Learn about Safari for Business Have an account? Sign in.