Runtime polymorphism can be achieved by:
Option A
The main use of virtual function is to achieve Runtime Polymorphism. Runtime polymorphism can be achieved only through a pointer (or reference) of base class type. Also, a base class pointer can point to the objects of base class as well as to the objects of derived class.
https://www.tutorialspoint.com/virtual-functions-and-runtime-polymorphism-in-cplusplus#:~:text=The%20main%20use%20of%20virtual,the%20objects%20of%20derived%20class.
64.3k questions
77.9k answers
244k comments
80.0k users