C语言程序哪里错了?提示使用了未定义类型

急求!实验大作业
2025-03-19 02:50:18
推荐回答(3个)
回答1:

1,
#include
#define n 3
struct course
{
float com_se, exp_se, exa_se, cou_tal_se;
};
struct student
{
int id;
char name[10];
struct course chi, math, eng;
float all_tal_se;
};
struct student stu[n];
int main()
{
List();
printf("请输入你要使用的功能前的数字\n");
while (1)
{
int command;
scanf_s("%d", &command, 1);
switch (command)
{
case 1:
Input();
break;
}
}
system("pause");
return 0;
}
2,
...省略
extern struct student stu[n];
void Input()
{
... 省略
scanf_s("%d %s %f %f %f %f %f %f %f %f %f", &stu[i].id, 1, stu[i].name, 10, &stu[i].chi.com_se,
&stu[i].chi.exp_se, &stu[i].chi.exa_se,
&stu[i].math.com_se, &stu[i].math.exp_se, &stu[i].math.exa_se,
&stu[i].eng.com_se, &stu[i].eng.exp_se, &stu[i].eng.exa_se, 1);
... 省略
}

回答2:

你结构体哪定义了

回答3:

我寻思你也没定义啊