课本照敲也有错,c
#include"stdio.h"#include"stdlib.h"
struct stud_type
{
char name[20];
long num;
int age;
char sex;
};
main()
{
void list(struct stud_type student);
struct stud_type student[3],*p;
int i;
char numstr[20];
for(i=0,p=student;i<3;p++,i++)
{
printf("Enter all data of student[%d]:\n",i);
scanf("%s%ld%d%c",p->name,&p->num,&p->age,&p->sex);
}
for(i=0;i<3;i++)
list(student[i]);
}
void list (student)
struct stud_type student;
{
printf("%-20s%8ld%6d%3c\n",student.name,student.num,student.age,student.sex);
}
我真的不知道怎么改了,求指教