I have created a struct which is composed of a char and a short. But the return value of sizeof( this struct) is 4 while I expect it to be 3. If I add a short, the the return value is 6.

Is there a way to accurately predict the result of sizeof(struct or class)? Thanks!

signature