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

1 thought on “ What is a virtual function in C++?”

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

Leave a Comment