I've defined a class MyClass
; it has no member functions, just data. Data is: 11 double
's and 3 unsigned short
That should amount a total of 94 bytes (11*8 + 3*2). However, if I print a sizeof(MyClass) to the console, it comes out with 96 bytes... Why?
And it becomes more puzzling: the same code in windows using MSYS and MinGW, comes out with a result of 104 bytes!!
I've checked, and in both platforms, double
's are 8 bytes and unsigned short
's are 2 bytes... So what are these extra bytes? How can I make sure the class will be the same size on both platforms (I intend to do a multiplatform app).