Jos wrote: > I mean isnt if(!f.eof()) equal to while(!f.eof())? Well no, one is a conditional and the other is a loop involving a conditional! ;-)
If one's in doubt about loop semantics, or the standard constructs don't seem to fit one's problem, it's often helpful to use a while (1) or for ( ; ;) infinite loop with break, and do all the condition checking and incrementing of variables yourself inside the loop. That way you know exactly what's going on, and when. Although the standard loop constructs are very useful, sometimes it's better to roll your own. David
