Google Interview Question
Software Engineer / DevelopersWhen you refer to a derived class object using a pointer or a reference to the base class, you can call a virtual function for that object and execute the derived class's version of the function.
Virtual functions ensure that the correct function is called for an object, regardless of the expression used to make the function call
- Venkata January 04, 2010