Polymorphism definition : Different classes that are generated by inheritance, send the same message to their objects, and different objects receive a different behavior (that is, methods).
A member function declared in a base class as vitual and redefined in one or more derived classes.The usage format is: vitual function return type function name (parameter table) {function Body};
To achieve polymorphism, access the overridden member function with the same name in the derived class by pointing to the base class pointer or reference of the derived class.
Virtual Functions : You can let member function operations generalize, when a base class pointer points to an object of a different derived class, the base class pointer calls its virtual member function, and it calls its member function that actually points to the object. Instead of the member function defined in the base class (as long as the derived class overrides the member function). If it is not a virtual function, it will call the function defined in the base class, regardless of which derived class object the base class pointer points to.
C + + polymorphism