So I'm using the >> operator to read objects from a file one by one. I am simultaneously counting the objects and need to read them again one by one to print from a certain point.
inFile.clear(); inFile.seekg( 0, ios::beg);
Doesn't seem to work for me, and I assume it is because I am using inFile >> variable instead of the get function. What would be the proper way of seeking back to the start of a file if you use the >> function so I can read input from the same file twice without closing it and reopening it.