CPP MCQ
What is a virtual function in C++?
A)
Any member function of a class
B)
All functions that are derived from the base class
C)
All the members that are accessing base class data members
D)
All the functions which are declared in the base class and is re-defined/overridden by the derived class

Correct Answer : Option (D) :   All the functions which are declared in the base class and is re-defined/overridden by the derived class

Explanation : Virtual function is a function that is declared inside the base class and is re-defined inside the derived class.