On 2/8/07, Lars Finsen <[EMAIL PROTECTED]> wrote: > In Borland's C++ I have problems getting eof() to work on a text file > opened as "ifstream(filename) ui", while the call that fails to find > EOF is "ui.eof()". Currently I am testing for some unique content of > the last line instead, but am unhappy with this. Any other > suggestions? I haven't found any bugs in Borland's C++ so far, and I > suspect the problem is due to my incomplete knowledge. I am just > beginning to learn C++ I/O.
It is very rare that you should be using EOF functions directly in a C or C++ program - you should instead be checking for an error in the reading of data from a file. Then, and only then, should you be using the EOF functions to determine if indeed it is the end of the file (or someone's removed the floppy disc from the drive etc.) Show your code! -- PJH #706281 +(1868)- [X] TriPod11: bush ain't THAT bad...he kinda knows what he's doin idaredbeet08: Please, Monica Lewenski had more President in her than George Bush ever will.
