Archived

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

Monder

Going back to the beginning of a text file

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