Make sure you use the correct directives and arguments with scanf. For example,
Code:
scanf("%d",std_ptr->id_num);
std_ptr->id_num is not an int.
[edit]
Code:
scanf("%f", &graderecord.homework);
Code:
scanf("%f",&grade.final);
Know your variable names and types.
[edit=2]
Code:
void read_in_students(struct graderecord *std_ptr)
{
int i,j,num_students;
printf("Number of students in class:");
scanf("%d",&num_students);
/* Input information about students */
for (i = 0; i < num_students; i++)
{
printf("Enter student name #%d: ", i+1);
scanf("%20s", std_ptr->name);
printf("Enter student id number: ");
scanf("%11s",std_ptr->id_num);
for (j = 0; j < grade_test; j++)
{
printf("Enter score on test #%d: ", j+1);
scanf("%f", &std_ptr->test[j]);
}
printf("Enter homework score; ");
scanf("%f", &std_ptr->homework);
printf("Enter the final exam score: ");
scanf("%f",&std_ptr->final);
}
}
[edit=last call]And note that you are reading all of these records into a single record.