Indeed - calm down It'd be very helpful to see an example that will compile and run. Or at least an example which shows your fopen, fscanf, fprintf calls and all the variables they use.
My guess would be that your fscanf isn't reading anything and the garbage in s and c is just uninitialised stuff, rather than garbage being read from the file. If you initialise c and s to a known value:
Then you can see if fscanf is reading garbage or reading nothing. That's not very "proper" but it's easy to understand.Code:char s = "Nothing"; char c = "Nothing";
If it's reading nothing, you can check feof() and ferror() to find out if end of file was reached or if an error occured.
There doesn't seem to be anything fundamentally wrong with what you posted -- that fscanf should read the file two words at a time. So the problem must be in some code you've not posted yet!