[Solved] What determines the distance between two structure members?
[ad_1] The reason this outputs 4 has to do with the size of each type and struct padding and alignment. On my system, sizeof(unsigned int) is 4, sizeof(long int) is 8, and sizeof(struct test) is 24. So to ensure that the 64-bit field lies on a 64-bit boundary, the structure is physically laid out like … Read more