|
From: Daniel K. O. <dan...@ya...> - 2004-12-21 05:11:34
|
Eduardo Rebellis wrote:
> while(!feof(fp)) {
> fscanf(fp, "%s", &word);
> printf(" %s ", word);
> }
>
>
The way you use feof() is wrong.
>Can anyone point me a way to correct such a
>unexpected behavior?
>
>
First thing: FORGET everything you learned about I/O in Pascal.
Then see:
http://www.lysator.liu.se/c/bwk-on-pascal.html#environment
and
http://www.drpaulcarter.com/cs/common-c-errors.php#4.2
Daniel K. O.
|