To achieve runtime polymorphism in C++, _______ are used. 

  • classes 
  • macros 
  • virtual functions 
  • inline functions
Runtime polymorphism in C++ is achieved through the use of virtual functions. These are functions in the base class that you can override in derived classes. The decision about which method to call (the one in the base class or the one in the derived class) is made at runtime, based on the actual type of the object being pointed to, rather than the type of the pointer. This allows for more dynamic behavior and is a core feature of object-oriented programming in C++.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *