All pastes #755026 Raw Edit

Unnamed

public text v1 · immutable
#755026 ·published 2007-10-30 12:29 UTC
rendered paste body
	int totalExams = 0;
	while(!feof(examfp)) {
		totalExams++;
		
		/* Load exam or die */
		if(!fscan_exam(examfp, &exams[totalExams - 1], key->questions)) {
			printf("Err: Malformed student exam on line %d\n", totalExams + 1);
			return FAILURE;
		}
		
		exams = realloc(exams, sizeof(struct t_exam) * (totalExams + 1)); // Reasize the array
		grade_exam(&exams[totalExams - 1], key); // grade exam
	}