Hey All. I'm trying to figure out how to search for a string within my file and if the string exists, I want to get whatever follows it. Here's an example:
HighScores.txt
----------------------------
Devin: 202
Corey: 185
Nick: 315
Patrick: 112
----------------------------
If my program opens the file, I'd like for it to search for a string ("Devin") and then get the number following it (202).
if ((offset = line.find(search, 0)) != string::npos)
can search for the string but I don't know how to get the number following it.
ideas?
Thanks for your time :)