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
As long as you stick to single inheritance, the subobjects are typically layed out in the order they are declared. A pointer is prepended to they type information at the front which is e.g. used for dynamic dispatch. Once multiple inheritance is incolved things become more complex, especially when virtual inheritance is involved.
To find precise information at least for one ABI flavour you can look for the Itanium ABI. This documents all these details. It is used as the C++ ABI at least on some Linux platforms (i.e. there multiple compilers can produce object files linked into one executable).
To determine the layout just print the addresses of subobjects of a give object. That said, unless you happen to implement a compiler it typically doesn't matter. The only real use of the object layout I doubd is arranging members to minimize padding.