[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: File input problem


>>   for( int j = 0; j < i; ++j )
>Make that j < i - 1 and you should be fine.

I checked.. (j < i) is right.

>Maybe that is wrong. I am using my C concepts here (assuming 
>method equivalent to the stdio function feof()).

I even tried (!infile.eof())

>> <test.txt contents>
>> linux
>> <test.txt contains *only* five characters>
>six, my friend, there is a newline at the end.

I checked it with the HEX editor in KDE, this file had five 

This silly problem is eating my head :)