参考博文来源链接
VC下实测
#include<stdio.h>
typedef struct bb{
int id;
double weight;
float height;
char data[10];//新增
}BB;
typedef struct cc{
char name[2];
int id;
double score;
short grade;
BB bb;
}CC;
int main()
{
printf("BB-> weight=%d \r\n", (int)&((BB *)0)->weight);
printf("BB-> height=%d \r\n", (int)&((BB *)0)->height);
printf("sizeof BB =%d \r\n", sizeof BB);
printf("CC-> id=%d \r\n", (int)&((CC *)0)->id);
printf("CC-> score=%d \r\n", (int)&((CC *)0)->score);
printf("CC-> grade=%d \r\n", (int)&((CC *)0)->grade);
printf("CC-> bb=%d \r\n", (int)&((CC *)0)->bb);
printf("sizeof CC =%d \r\n", sizeof CC);
return 0;
}