I'm writing a program that scans a file and in doing so calls seekg() a lot. It spins in a loop, the condition of which is !infile.eof(); so it should exit the loop when it gets to the end of the file. However, for some reason it gets stuck.
I suspect that the reason for this might be because it is reaching the end of the file while in seekg(). In other words, if I am 50 bytes from the end of the file and I call seekg() and tell it to move the pointer 100 bytes, maybe that makes it get stuck (either in seekg() or after that).
So, what does seekg() in fact do when asked to move the pointer past the end of the file?