Is there any difference in memory layout for composition vs inheritance?

后端 未结 0 628
半阙折子戏
半阙折子戏 2020-12-08 04:29
struct A
{
int a, b, c;
int fa() { /*something*/}
};

struct B1 : A
{
int a1, b1, c1;
int ba() { /*something */}
};

struct B2
{
A a;
int fa() {a.fa();}
int a2, b2,          


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题