c语言问题 ,高手帮忙!

来源:百度知道 编辑:UC知道 时间:2024/05/18 01:35:55
struct stud_typ
{
char name[20];
long num;
int age;
char sex;
float score;
}student;
main()
{
void student(struct stud_typ student);
struct stud_typ student[3];
int i;
char numstr[20];
for(i=0;i<3;i++)
{
printf("enter all the data of student[%d]:\n",i);
get(student[i].name);
get(numstr);student[i].num=atol(numstr);
get(numstr);student[i].age=atoi(nunstr);
get(student[i].sex);
get(numdtr);student[i].score=atof(numstr);
}
printf("\nrecord\t\tname\t\t num age sex score")
for(i=0;i<3;i++)
void student(student[i]);
}
void student(struct stud_typ student)
{
printf("%3d%-20s%8d%6d%3c%6.2f\n",i,student[i].name,student[i].num,student[i]
.age,student[i].sex,student[i].score);
}
看一看错误在哪?

1.main函数要有返回值
2.void student(struct stud_typ student);不能用在main函数里面,c言 中函数可以嵌套调用,但是不能嵌套定义
3.要是把定义的函数写在调用的函数后面,前面应该有声明

你至少应该把出现了什么问题说明一下!现在是你找人解决困难而不是别人找你出个哑谜打发时间。