After I reach EOF, how can I change the location of the pointer reading the file? I've tried:
F.seekg(ios::beg);
F.seekg(0,ios::beg);
F.seekg(0);
tellg still returns -1.
Printable View
After I reach EOF, how can I change the location of the pointer reading the file? I've tried:
F.seekg(ios::beg);
F.seekg(0,ios::beg);
F.seekg(0);
tellg still returns -1.
Try calling clear() before seekg.
When you hit EOF some of the error flags are set to true and in order to reset those flags,Quote:
Try calling clear() before seekg.