memory layout of inherited class

后端 未结 5 634
不知归路
不知归路 2021-02-04 05:25

I\'m keen to know exactly how the classes will be arranged in memory esp. with inheritance and virtual functions.

I know that this is not defined by the c++ language st

5条回答
  •  耶瑟儿~
    2021-02-04 05:46

    The best way is probably writing a few simple test cases and then compile and debug them in assembler (all optimization off): running one instruction at a time you'll see where everything fits.

    At least that's the way I learned it.

    And if you find any case particularly challenging, post in in SO!

提交回复
热议问题