Polymorphism in C++ is supported with the use of dynamic binding with the use of virtual functions.
There are two things to do when you want to use dynamic binding:
- Only member functions that are declared virtual are dynamicallly bound.
- The call must be made through a pointer or reference to a base class.
When these conditions are met, the function call is dynamically bound. Otherwise, the function is resolved at runtime. And dynamic binding is how C++ supports polymorphism. (Although I believe templates support a different kind of polymorphism, dynamic binding polymorphism is what people mean when they simply say polymorphism...)