How is inheritance implemented at the memory level?

前端 未结 5 1117
无人共我
无人共我 2021-02-13 15:36

Suppose I have

class A           { public: void print(){cout<<\"A\"; }};
class B: public A { public: void print(){cout<<\"B\"; }};
class C: public A         


        
5条回答
  •  遇见更好的自我
    2021-02-13 16:23

    Check out the C++ ABI for any questions regarding the in-memory layout of things. It's labelled "Itanium C++ ABI", but it's become the standard ABI for C++ implemented by most compilers.

提交回复
热议问题