is there a way to set the istream back to the begining of the file?
is there a way to set the istream back to the begining of the file?
my appologies, i meant ifstream, and i think seekg may be the answer, but i have got to go out, i will post my result for any who are interested.
Yes, use seekg but you will likely also need to use clear first.
Code:ifstream input; string data; // Read until end of stream do { getline(input,data); // Do stuff } while( !input.eof() ); // Seek back to beginning of stream input.clear(); input.seekg(0L,ios::beg); // Do more stuff with input stream
"Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
-Christopher Hitchens
my friend, thank you for the pointer on Clear().... you saved me from redesigning a vb interface at the last minute.