Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

moving back to beginning of ifstream 1

Status
Not open for further replies.

biot023

Programmer
Nov 8, 2001
403
GB
Hallo.
Does anyone know a way to move back to the beginning of the file with the ifstream class?
I have an ifstream in a function, but not the open file's name, so I can't just close & reopen.
Any & all help gratefully recieved.
Cheers,
Douglas JL.

Common sense is what tells you the world is flat.
 
As i do not find the ifstream-class in the help i'm not entirely shure but i would believe that there should be some kind of SetPosition and that would do the trick. Ig it's anything like the file SetPosition You should set the offset to 0 and make that from the beginning.

Totte
 
Yup - the function was called seekg, of all things!
How on earth did I miss that 1st time 'round?
Thanks alot,
DJL

Common sense is what tells you the world is flat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top