I'm a begginer at c++, so I wanted to ask, how can I take data from fstream
after I already took all the data from it?
I have done something like this
fstream file;
string data, key, key2;
while(file>>data)
{
key += data;
}
Now I want to do it again with the same file but without re-open it:
while(file>>data)
{
key2 += data;
}
How can I do that with fstream
?
Rewind the stream: