I've tried closing and opening the fstream, and ive tried using seekg( 0, ios::beg ) but those arent working for me. Right now i have a function that reads through the file once to read how many lines there are, then once that while loop breaks i try to reset it to look through the file again for different characters. Any ideas?
EDIT***: Changed it so the counting lines is in a different function but its still not working.
Since the stream object has encountered eof it is in a bad state, so you must clear it with fstrObj.clear();. Then you can fstrObj.seekg(0); without needing to close and reopen the file.