I am opening a file
ifstream data ("data.txt");
and then reading some details from it.
while (getline(data, line, '\n'))
I would then like to go back to the start of the file so that I can read through it again.
I am trying to use data.seekg(0, ios::beg) but when I run data.getline() it still only grabs the last entry in the file.
How can I go back to the start of the file. Do I need to close the file and then open it again?