对象内存布局 (10)

来源:互联网 发布:奴婢知奴婢知错跪罚 编辑:程序博客网 时间:2024/05/16 15:50

对象内存布局 (9)基础上做些修改:派生类override基类的虚函数,即Base2 override Base1中声明的虚函数vfBase1(),Base3 override Base1中声明的虚函数vfBase1()和Base2中声明的虚函数vfBase2(), Derived override Base1中声明的虚函数vfBase1()、Base2中声明的虚函数vfBase2()和Base3中声明的虚函数vfBase3()。运行结果如下:

 

 

Derived对象的memory layout图解如下: