std::string szKeyWord;
...
std::stringstream szBuffer(szLine);
szBuffer>>szKeyWord;
...
szBuffer<<szKeyWord;
szBuffer>>myIntVar; // will NOT format keyword here, will act as the line above never happened.
Pretty much self explanatory. I want to undo the last ">>" and use it as if it never happens.
Context: Im checking for keywords, but if its not a keyword, I should keep collecting it as data, because its an array data, and there can be comment between lines.
EDIT:
After a LOT of try and error, I get this to work:
szBuffer.seekg((int)szBuffer.tellg() - (int)szKeyWord.length());
Dont look elegant to me, but looks like its working fine.