So i\'ve read all the lines from a file thusly
while (getline(ifile,line)) { // logic }
Where ifile is an ifstream and line
This is because the eof flag has been set on the stream - due to you reaching the end of the file. so you have to clear this as an additional step.
Eg
ifile.clear(); ifile.seekg (0, ios::beg);