I found just a great article: Determining the Size of a Class Object.
So short and so simple.
The factors that determine the size of a class objects are the following:
- Size of all non-static data members
- Order of data members
- Byte alignment or byte padding
- Size of its immediate base class
- The existence of virtual functions.
- Compiler being used
- Mode of inheritance (virtual inheritance)
No comments:
Post a Comment