结构体变量怎么用
#include <stdio.h>struct student
{
int num;
char name;
float score[3];
}stu[N];
int i;
int main()
{
struct student stu[5];
void print(struct student stu[5]);
for(i=0;i<5;i++)
{printf("请输入学号:\n");
scanf("%d",stu[i].num);
printf("请输入名字:\n");
scanf("%s",stu[i].name);
printf("请输入成绩:\n");
scanf("%f %f %f",stu[i].score[0],stu[i].score[1],stu[i].score[2]);
}
print(stu);
return 0;
}
void print(struct student stu[5])
{
for(i=0;i<5;i++)
{
printf("%d\n%s\n%f %f %f\n",stu[i].num,stu[i].name,stu[i].score[0],stu[i].score[1],stu[i].score[2]);
printf("\n");
}
}
一用到结构体变量运行的时候就会出现assess violation 到底是哪里出错了?