虚函数如何在c ++中工作 [英] How Virtual functions works in c++

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

问题描述







我明白这一点,比如如何创建虚拟功能及其使用方法,但内部如何vtable被创建以及如何在运行时执行函数调用。





问候,

Ranjith

Hi,


I Understand that, like how to create a virtual function and what is use of it ,but internally how vtable gets created and how function call get executed during runtime.


Regards,
Ranjith

推荐答案

请参阅 https:// www .google.com / search?q = c%2B%2B +虚拟+功能 [ ^ ]。


请参阅以下链接: -

了解虚函数内部结构 [ ^ ]

虚拟表和虚拟表如何在C ++中工作 [ ^ ]
refer below link:-
Understand Virtual functions Internals[^]
How Virtual Table and Virtual Table works in C++[^]


参见例如维基百科页面:虚拟方法表 [ ^ ]。
See for instance this Wikipedia page: "Virtual method table"[^].


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

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