In C++, is there a function in the fstream library (or any library) that allows me to read a line to a delimiter of '\n' without extracting?
I know the peek() function allows the program to 'peek' at the next character its reading in without extracting but I need a peek() like function that does that but for a whole line.
You can do this with a combination of
getline
,tellg
andseekg
.