my program reads a line from a text file using:
std::ifstream myReadFile("route.txt"); getline(myReadFile, line)
And if it finds what I'm looking for (tag), it will save that string in temp String. I will not continue this until I find some other tag, if I find another tag, I want to go back to the previous line so that the program reads, if again, like some other tags and do something else .
I look at putback () and unget (), I am confused about how to use them, and if they might be the right answer.
source share