c 怎么统计这类型数组元素个数?
//结构
struct student {
int num; //学号
char *name; //姓名
float score1; //数学
float score2; //语文
float score3; //英语
}stu[]={
{1, "士大夫", 78, 69, 33},
{2, "撒的", 30, 54, 63},
{3, "但是", 89, 45, 34},
{12, "按时", 15, 76, 86},
{5, "额外", 76, 35, 86},
{6, "十是", 90, 43, 54},
{7, "似的", 89, 43, 62},
{9, "反对", 89, 43, 62},
{10, "按时", 89, 34, 53}
};
void main() {
int stu_size = sizeof(stu);
printf("%d\n",stu_size);
}
我这样打印出来的不是数组元素,而是252?
为什么呢?应该如何统计,系统有函数吧!