i wont change anything this time other than shorten it. i thought changing it would help but it only made it worse i guess. here...
Code:
void readempname(FILE* fin, struct employee a[1024], int num_emp) ;
int main() {
int emp;
readempname(fin, a, emp);
printf("%d\n", emp);
}
void readempname(FILE* fin, struct employee a[1024], int num_emp) {
int i=0;
// read in # of employees
fscanf(fin, "%d", &num_emp);
//read in first name / last name / pph
for (i = 0; i < num_emp; i++) { <--------- Getting warning on this line after i apply your suggested changes.
fscanf(fin, "%s", a[i].first);
fscanf(fin, "%s", a[i].last);
fscanf(fin, "%lf", &a[i].payperhr);
}
printf("%d\n", num_emp);
}
output is:
2
0
did that make more sense? that is what i have now.