Why I will get a run time error message?Can some body pls show the wrong place?
#include<stdio.h>
#define MAX_STU 50
typedef struct{
int id;
double gpa;
} student_t;
void scan_student (student_t *s)
{
printf("\nEnter student id>");
scanf("%d", &s->id);
printf("\nEnter student gpa>");
scanf("%lf", &s->gpa);
}
main()
{
student_t stulist[MAX_STU];
int i;
for(i=0; i<MAX_STU; ++i)
scan_student (&stulist[i]);
for(i=0; i<MAX_STU; ++i)
printf("%d\n", stulist[i].id);
}