W
Willem
As we all know, the following code is not quite correct:
while (!feof(fp)) { fgets(...); /* do_something */ }
And should be replaced by:
while (fgets(...)) { /* do_something */ }
But can the faulty code have the result that the loop body is *not*
called, even though there is data in the file ?
I'd say no, because there hasn't been anything yet that could have set the
end-of-file indicator, but I have a program which copies data and once in
a while, it produices an empty file.
SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
while (!feof(fp)) { fgets(...); /* do_something */ }
And should be replaced by:
while (fgets(...)) { /* do_something */ }
But can the faulty code have the result that the loop body is *not*
called, even though there is data in the file ?
I'd say no, because there hasn't been anything yet that could have set the
end-of-file indicator, but I have a program which copies data and once in
a while, it produices an empty file.
SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT