函数问题括号里的意思
#include "stdio.h"#define N 2
int i;
struct course{
int Chinese;
int Math;
int English;
int Java;
int C;
};
struct person{
char number[15];
char name[15];
char sex[15];
struct course score;
};
void fnDataIn(struct person data[],int n);
void fnDataOut(struct person data[],int n);
void fnDataIn(struct person data[],int n)
{
printf("Pls input students:number,name,sex,course(Chinese,Math,English,Java,C)\n");
for(i=0;i<n;i++)
scanf("%s%s%s%d%d%d%d%d",data[i].number,data[i].name,data[i].sex,&data[i].score.Chinese,&data[i].score.Math,&data[i].score.English,&data[i].score.Java,&data[i].score.C);
}
void fnDataOut(struct person data[],int n)
{
for(i=0;i<n;i++)
printf("\n%s %s %s\nChinese:%d\nMath:%d\nEnglish:%d\nJava:%d\nC:%d\n",data[i].number,data[i].name,data[i].sex,data[i].score.Chinese,data[i].score.Math,data[i].score.English,data[i].score.Java,data[i].score.C);
}
void main()
{
struct person a[N];
fnDataIn(a,N);
fnDataOut(a,N);
getch();
}
里面的void fnDataIn(struct person data[],int n);的(struct person data[],int n)是什么意思?还有主函数(a,N)也不懂。还有n是什么?
[ 本帖最后由 Kevin姜 于 2013-6-19 20:32 编辑 ]