#include #include #include struct person { char first[20]; char last[20]; int score[2]; float ratio; }; struct person p, q; int main() { printf("offset(first) =%d\n", offsetof(struct person, first)); printf("offset(last) =%d\n", offsetof(struct person, last)); printf("offset(score[0])=%d\n", offsetof(struct person, score[0])); printf("offset(score[1])=%d\n", offsetof(struct person, score[1])); printf("offset(ratio) =%d\n", offsetof(struct person, ratio)); printf("total =%d\n", (void*)&q - (void*)&p); }