Methods and file pointers

This is a discussion on Methods and file pointers within the C Programming forums, part of the General Programming Boards category; I am pretty confident that I wrote my requestFileName correctly, but my program crashes every time I run it, so ...

/*
* remove the extra & at fp
*
* fileScan does return any value therefore while can't work checking if it is the EOF
* population, squareMilege, pollution, crime, expense, highways are not the same that in the function;
* those are a copy
*/
while(fileScan(fp, cityName, population, squareMileage, pollution, crime, expense, highways) != EOF) // get next char from input file until we reach EOF
{
//...
}

If you're supposed to use FILE **fp, then make sure your fscanf has *fp as the first argument.

Edit: although I can't think of a good reason (or, for that matter, any reason at all, really) for you to need **fp here. (The whole point of everything in C using FILE * was that you could pass it around functions and everything would work the way you expect.)

I took out the void, and Now i am getting 2 warnings which I don't understand:
Warning 3 warning C4028: formal parameter 1 different from declaration
Warning 4 warning C4028: formal parameter 2 different from declaration

I took out the void, and Now i am getting 2 warnings which I don't understand:
Warning 3 warning C4028: formal parameter 1 different from declaration
Warning 4 warning C4028: formal parameter 2 different from declaration

It means your definition and declaration doesn't match.
And remember that all functions should return something. Not nothing. If it doesn't need to return anything, it should return void. In your case, it should return int.
And as mentioned, update your prototype to match the new definition.

I took out the void, and Now i am getting 2 warnings which I don't understand:
Warning 3 warning C4028: formal parameter 1 different from declaration
Warning 4 warning C4028: formal parameter 2 different from declaration

Try again, and this time pay attention: you do not have a function prototype for fileScan. Therefore your code will not work. Put a function prototype for fileScan at the top of the file, or put it in an included header file.

I put int in both my prototype call and function call and added a return statement, I no longer receive:
Warning: formal parameter 1 different from declaration,
But i do receive Warning: formal parameter 2 different from declaration.

Also I would like to thank everyone who has responded and put up with my stupidity.