// ²òÅú4.1 strsize.c #include #include struct person { char firstname[20]; char lastname[20]; int score[2]; float ratio; }; struct person p,q; int main() { void *base = (void*)&p; printf("off(firstname)=%d\n", (void*)&(p.firstname)-base); printf("off(lastname )=%d\n", (void*)&(p.lastname )-base); printf("off(score[0] )=%d\n", (void*)&(p.score[0] )-base); printf("off(score[1] )=%d\n", (void*)&(p.score[1] )-base); printf("off(ratio )=%d\n", (void*)&(p.ratio )-base); printf("total =%d\n", (void*)&q - base); }