Pages

Wednesday, November 25, 2009

Size of a class object

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:

  1. Size of all non-static data members
  2. Order of data members
  3. Byte alignment or byte padding
  4. Size of its immediate base class
  5. The existence of virtual functions.
  6. Compiler being used
  7. Mode of inheritance (virtual inheritance)

No comments:

Post a Comment