Problem with loop and ifstream.seekg

Hi, i just don't get why this isn't working.
It is supposed to read from the end of a .txt and up, until it hits the first space but
it just keeps repeating the last character in the text file ip.txt
Any help is much appreciated.

Since you are using the 'end' flag in seekg(), all offset is relevent to the end of the file.. therefore, you should increment your way from the end of the file, stepping your way backwards into the text file.

You might also have a problem with initializing 'i' to -1.. keep this in mind if you continue to have problems.

Also, I would highly recommend opening your file in binary mode when messing about with the file pointers.. for some reason, when opened in regular ascii mode, it seems to dramatically affect the pointer offset position (you think you are at one place when you are really not)

You have an interesting scheme in place here, getting the line after each character test...

Edited 8 Years Ago
by Clinton Portis: want to hear a joke? ok, redskins are playing philli today.