#include struct A{ //Size of struct A should be 1+1+4+1+1=8 Bytes char a, b; int I; char c,d; }; struct B{ //Size of B is 8 bytes; Properly packed char a, b, c, d; int I; }; int main(){ printf("Asize=%ld Bsize=%ld\n",sizeof(struct A), sizeof(struct B)); return 0; } /* * $./a.out Asize=12 Bsize=8 * */