天天看点

c / c++ virtual function and pure virtual function summarize

0. Virtual function is used for multimod, it only can be used in Class except inline function, It's used at runtime

1. Pure virtual function is a virtual function.

2. Class with pure virtual function is a abstract base class, and can not be concreted. this class is only used as a

    parent class, and define the interface prototype.

3. Class with virtual function can be concreted, and used as a common class.

4. Virtual or pure virtual function have the same effect in multimode.

5. Virtual method can not used with static element, due to static element belongs to all class object, and generated  

    the build time, but virtual function only can used for one object, and used at run time. 

6. Pure virtual method must be implied in son class, but it's necessary when it's a virtual method.