You can move the position (using seekg) either by an offset, or to a previous point (that was saved by tellg). Unless your file is very strictly formatted, you probably want the latter. So in your case, call tellg to get the file position before reading the fifth line, then use seekg to return to that position.
Though if you're saving those integers into variables, why do you need to read them again? They're already in memory for you. :icon_rolleyes:
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401