Here's an example using istream which defines seekg.
English
-
Thanks dazarobbo! Do you know how I could use this with a txt file?
-
[url=http://www.cplusplus.com/reference/fstream/fstream/]fstream[/url] inherits from istream, so you can call .seekg on an fstream object. There's an example [url=http://www.cplusplus.com/reference/fstream/fstream/fstream/]here[/url] for creating an input stream for a file.