您的位置:首页 > 编程语言 > C语言/C++

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

2010-07-16 10:09 375 查看
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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: