K
Kouisawang
Example code:
--------------------------------------------------------------------------------
class Foo{
private:
double a;
int b;
};
--------------------------------------------------------------------------------
Question here is that when member variable is of type int (require 4
bytes)
and double (require 8 bytes), why the total size is 16, not 12?
I used "sizeof" to check the size.
Thanks in advance
-O.Kittipot
--------------------------------------------------------------------------------
class Foo{
private:
double a;
int b;
};
--------------------------------------------------------------------------------
Question here is that when member variable is of type int (require 4
bytes)
and double (require 8 bytes), why the total size is 16, not 12?
I used "sizeof" to check the size.
Thanks in advance
-O.Kittipot