Image

Imageopenreel wrote in Imagecpp

Forcing a file stream to stay open?

In the course of searching through a whole file for something (via ifstream), I may or may not reach the end of the file. So mystream.eof() may or may not be true. Either way, I want to continue to use the stream after that point. I know how to navigate back and forth with seekg() and tellg(). But I don't know the correct way to keep it from closing in the first place.

I tried closing and reopening the stream after my search, but that didn't seem to work consistently.