各位大虾们帮忙看下那错了!!
#include <stdio.h>#include <stdlib.h>
struct stud_tpye
{char name[20];
long num;
int age;
char sex;
};
main()
{
struct stud_tpye student[1],*p;
int i;
char numstr[20];
for (i=0,p=student;i<1;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,p=student;p<student+1;p++,i++);
printf("%3d%-20s%8ld%6d%3c\n",i,p->name,p->num,p->age,p->sex);
}