struct问题
#include<stdio.h>int main()
{
struct Data
{
int year;
int month;
int day;
};
struct stu{
char stunum[10];
struct Data stubirthday;
float h;
float w;
}one;
printf("%d\t",sizeof(one));//32
//////////////
struct stu2
{
char s[15];
float score[4];
}team;
printf("%d\n",sizeof(team));//32
//////////////////////////
struct str
{
float a,b;
char c[6];
};
printf("%d\n",sizeof(struct str));//16
return 0;
}
为什么会有如下警告?
E:\C语言编程\201107验证\sizeof.cpp(23) : warning C4101: 'team' : unreferenced local variable
E:\C语言编程\201107验证\sizeof.cpp(15) : warning C4101: 'one' : unreferenced local variable