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

Re: File input problem



Hi,

>>   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 
infile.good()
>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 
chars.

This silly problem is eating my head :)

Ashwin