Possible Duplicate:
Why isn't sizeof for a struct equal to the sum of sizeof of each member?
I created a Struct randomly and the size of it surprised me because the result does not equal to my calculation:
int main( int argc, char ** argv ) {
struct S
{
int i;
int b;
int c;
long int e;
};
cout << sizeof (struct S) << endl; //sizeof is still an operator
return 0;
}
Normally, 3*int + 1*long int = 3*4 + 8 = 20.
However, the result is 24.
Where are this 4 bytes comes from?