error LNK2001: 无法解析的外部符号 "struct student * stu" (?stu@@3PAUstudent@@A)
解决时间 2021-02-08 12:35
- 提问者网友:原来太熟悉了会陌生
- 2021-02-08 00:49
#include
#include "stdio.h"
struct student
{
int num;
char name[20];
float score[3];
}stu[];
void print(struct student stu[], int n)
{
int i;
for(i=1;iprintf("%d,%s,%f,%f,%f\n",stu[i].num,stu[i].name,stu[i].score[0],stu[i].score[1],stu[i].score[2]);
}
void input (struct student stu[],int n )
{ int i; printf("please input dates:");
for(i=1;i {scanf("%d,%s,%f,%f,%f",&stu[i].num,stu[i].name,&stu[i].score[0],&stu[i].score[1],&stu[i].score[2]);
printf("\n");}}
int main()
{int n;
printf("Please input the numbers of the student:");
scanf("%d",&n);
input (stu,n);
print (stu,n);
return 0;
}
最佳答案
- 五星知识达人网友:酒醒三更
- 2021-02-08 01:11
struct student
{
int num;
char name[20];
float score[3];
}stu[50];
全部回答
任务占坑
我要举报
大家都在看
推荐资讯