So i\'ve read all the lines from a file thusly
while (getline(ifile,line)) { // logic }
Where ifile is an ifstream and line
Since you have reached (and attempted to read past) the end of the file, the eof and fail flags will be set. You need to clear them using ifile.clear – then try seeking:
eof
fail
ifile.clear
ifile.clear(); ifile.seekg(0);