Cognizant interview question

What is virtual function?

Interview Answer

Anonymous

Sep 4, 2019

Virtual function is member function, which declared inside base class, used to get the derived version of that override function. Virtual function is used to achieve runtime polymorphism.