• Advertisement


This topic is now archived and is closed to further replies.

Going back to the beginning of a text file

This topic is 5715 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok I''m writing a text parser. I want to do two seperate passes on the file. This means I have to start reading from the top of the file again. My first thought on how to do this was using seekg(I''m using an ifstream btw) so I''d go like this MapFile.seekg(0,ios::beg); It didn''t work. I then thought I could try closing the file then re-opening so it started reading from the top again. So I used this MapFile.close; MapFile.open("thing.map"); It still didn''t work. Can anybody tell me the way you''re meant to do it(or at least a way that works)?

Share this post

Link to post
Share on other sites

  • Advertisement