CBFalconer <cb********@yahoo.comwrites:
Willem wrote:
>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 */ }
Try "while (!fgets(...)) {/* do_something */}". It'll work better.
Um, how so? fgets() returns its first argument on success, or a null
pointer if nothing is read.
--
Keith Thompson (The_Other_Keith) <ks***@mib.org>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"