Hi,
I am reading a simple text file as following:
So, after reading past the complete file; I now want to reset the ifstream object (here infile). So, that I can again start reading the file from the first line in the next part of the code. Can somebody please tell me how to do this?Code:ifstream infile("doc.kml"); string line; while (infile >> line) { ........ ........ ....... ...... ........ }
I know, I could just close the file and open it back again, but isn't there some more straightforward method for this?
Thanks a lot in advance.