Question: when do we need virtual functions in c++
Answer: when a derived class inherits from a base class , an object of the derived class may be referred to via a pointer or reference of the base class type instead of the derived class type