1. Virtual function (impure virtual)
C + + virtual function is mainly to provide "runtime polymorphism", the parent class provides the default implementation of virtual functions, subclasses can be overridden by virtual functions.
2. Purely virtual functions (pure virtual)
C + + pure virtual functions are also "run-time polymorphic", the parent class cannot provide the implementation of the function, the subclass provides the implementation of the function. Classes that contain pure virtual functions, called "abstract classes", cannot be used with the new
To implement an object, only subclasses of the virtual function can implement the new.
3. Common function (no-virtual)
The normal function is statically compiled and is a mandatory implementation provided by the parent class to the child class.
virtual function Analysis of C + +