What is Polymorphism in C++?

When the same function demonstrates different behavior it is known as polymorphism and it is of two types:-

Compile time polymorphism: The overloaded functions are invoked by matching the type and number of arguments.

Run time polymorphism: Run time polymorphism is achieved when the object’s method is invoked at the run time instead of compile time