求助,编写input()和output()函数输入,输出5个学生的数据记录。
代码如下,在vs2008上编写的#include <stdio.h>
#define N 5
struct STUDENT
{
char num[6];
char name[8];
int score[4];
}
stu[N];
int input(stu)
struct STUDENT stu[];
{int i,j;
for(i=0;i<n;i++){
printf("\nplease input %d of %d\n",i+1,N);
printf("num:");
scanf("%s",stu[i].num);
printf("name:");
scanf("%s",stu[i].name);
for(j=0;j<3;j++){
printf("score %d.",j+1);
scanf("%d",&stu[i].score[j]);
}
printf("\n");
}
}
int print(stu)
struct STUDENT stu[];
{int i,j;
printf("\nNo. Name Sco1 Sco2 Sco3\n");
for(i=0;i<N;i++){
printf("%-6s%-10s",stu[i].num,stu[i].name);
for(j=0;j<3;j++)
printf("%-8d",stu[i].score[j]);
printf("\n");
}
}
int main(){
int input();
int print();}
报错: error C2448: “input”: 函数样式初始值设定项类似函数定义
error C2448: “print”: 函数样式初始值设定项类似函数定义