peek() with ifstream - Now more interesting!
C'mon somebody must at least want to look at this thread......... ;-) I just need to know how to force an ifstream object back one "space" in a file.
Ah well, the title didn't update did it....
Hi,
Does peek() increment the file pointer or does it just look at the next int then decrement back to where it was before peek() was called?
To add to this:
If it does increment, which I think it does, how do I decrement back one "space". It sounds such a simple thing to want to do but I've not found how to yet.
Reason is I have a function that needs to know the value of an int before calling an overloaded >> operator for a class, but, the >> operator also needs to read this same int (it wouldn't if it was only used from this function, but it isn't.....)
Cheers.