Cognizant interview question

What is virtual function?

Interview Answer

Anonymous

4 Sept 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.