虚拟表和虚拟表如何在C ++中工作 [英] How Virtual Table and Virtual Table works in C++

查看:107
本文介绍了虚拟表和虚拟表如何在C ++中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有个问题.而且我在Google上找不到任何相关的答案.我的问题是虚函数机制如何工作.表示在编译时实际发生的情况,在运行时实际发生的情况以及纯虚函数在VTable中的存储方式.

以及Pure Virtual Function如何使类抽象.

谢谢

Hi,

I have a question. And I am not able find any relevant answer on Google. My question is How Virtual Function mechanism works. Means what exactly happens at compile time, what exactly happens at run time and how pure virtual functions are stored in VTable.

And exactly how Pure Virtual Function makes a class abstract.

Thanks

推荐答案

尝试此链接. CPians已清楚地说明了有关虚拟功能的信息[ ^ ]

也可以查看此内容[ ^ ]
Try this link. CPians have clearly explained about Virtual Functions [^]

Have a look at this also [^]


您可能会在C ++常见问题解答的 [
You may find precious info at C++ FAQ''s "[20] Inheritance — virtual functions"[^].


这篇关于虚拟表和虚拟表如何在C ++中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆