有虚继承的类其有几个虚继承的基类则该类就有几个虚表

对于下面的测试代码(64位系统):C类继承了A  B 均为虚类,因此在结果中sizeof(C) 结果为32 ios #include<iostream>git using namespace std; class A { virtual void test() {} private: int a; }; class  B { virtual void test() {} float b; }; c
相关文章
相关标签/搜索