期刊文献+

C++中虚函数的实现机制 被引量:6

Implementation mechanism of virtual functions in C++ programming language
下载PDF
导出
摘要 介绍了C++编程语言中的虚函数及其在进行面向对象程序设计中重要性,并且详细阐述了它在编译器底层虚函数的实现机制.它通过一个vptr和vtable在运行时进行动态绑定,从而能够根据对象类型的不同调用不同的虚函数;并通过实例测试验证了上述机制. The virtual function in C+G-+ and its importance are introduced in this article, and the implementation mechanism of the virtual function is expounded in detail. It is dynamically bound through a virtual pointer(vptr) and virtual table during the running time, and so different class virtual function are called by the object′s type; and this mechanism is verified through a testing program.
出处 《天津理工学院学报》 2004年第3期65-67,共3页 Journal of Tianjin Institute of Technology
基金 天津市自然科学基金资助项目(033600211)
关键词 C++ 虚函数 实现机制 面向对象程序设计 C++ virtual function implementation mechanism
  • 相关文献

参考文献4

  • 1侯俊杰.深入浅出MFC[M].武汉:华中科技大学出版社,2001..
  • 2BjarneStroutsup.The C + + Programming Language(Special Edition)[M].北京:高等教育出版社,2001..
  • 3ZippmanL 侯捷译.深度搜索C + +对象模型[M].武汉:华中科技大学出版社,2001..
  • 4麦中凡.C + +程序设计语言教程(语言基础)[M].北京:北京航空航天大学出版社,1996..

共引文献63

同被引文献31

引证文献6

二级引证文献37

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部