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.
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.
相关文章推荐
- [C++] Pure Virtual Function and Abstract Class
- C++ 纯虚函数 pure virtual function && ABC
- C++: Pure Virtual Function Called
- 【转载】一篇详尽分析C++“Pure Virtual Function Called”错误的文章
- Pure Virtual Functions and Abstract Classes in C++
- C++中的"pure virtual function call"
- 【C++基础】纯虚函数 - pure virtual function
- Something about virtual function and pure virtual function
- C++ pure virtual function call
- C++ virtual function (not pure virtual function)
- C++中的"pure virtual function call"
- The error “Pure Virtual Function Called” about C++
- Some tips about Abstract base classes and pure virtual functions
- What is a pure virtual function?
- "Pure Virtual Function Called" 纯虚函数调用错误分析(翻译)
- 运行opencv程序后出现runtime error! R6025-pure virtual function call 错误提示的解决方法
- pure virtual function call--虚函数调用的错误
- Member Function Pointers and the Fastest Possible C++ Delegates - 成员函数指针与高性能的C++委托
- Can we use function on left side of an expression in C and C++?
- C++中friend的使用(friend function and friend class)