Code:
/* prototype call */
fileScan(FILE **fp, char *cityName, int population, int squareMileage,
int pollution, int crime, int expense, int highways);
Code:
/* Main Call */
while(fileScan(fp, cityName, population, squareMileage, pollution, crime, expense, highways) != EOF) // get next char from input file until we reach EOF
{
//...
}
Code:
/* method */
fileScan(FILE *fp, char cityName, int population, int squareMileage, int pollution, int crime, int expense, int highways)
{ /*ERRORS: Warning 3 warning C4028: formal parameter 1 different from declaration
Warning 4 warning C4028: formal parameter 2 different from declaration */
fscanf(fp, "%s %d %d %d %d %d %d", cityName, population, squareMileage, pollution, crime, expense, highways);
}