I'm having two compile errors when trying to compile my code, and I can't find what the issue really is. Could anybody help shed some light?
error: old-style parameter declarations in prototyped function definition
error: 'i' undeclared (first use in this function)
Code:
void printRecords (STUREC records[], int count)
STUREC records[ARRAY_MAX];
int count;
int i;
{
printf("+---------------------------+--------+--------+--------+--------+--------+--------+---------+-------+\n");
printf("| Student Name | ID | Test 1 | Test 2 | Proj 1 | Proj 2 | Proj 3 | Average | Grade |\n");
printf("+---------------------------+--------+--------+--------+--------+--------+--------+---------+-------+\n");
for (i = 0; i < count; i++)
{
size_t j;
printf ("|%s|%d|%d|%d|%d|%d|%d|%f|%c|", records[i].name, records[i].id, records[i].score1,
records[i].score2, records[i].score3, records[i].score4, records[i].score5,
records[i].ave, records[i].grade);
}
return;
}