Resetting streams... (I think...)

Recommended Posts

This came up awhile ago, but it didn't really get answered (it was just tacked onto the end of another thing)...does anyone know how to reset (I think that' what it's called) a stream, specifically a file stream? I was told I needed to do this if I was going to input the file to an int rather than a char. example:

int number;
file >> number;

if there's a better way to do this without resetting the stream (or whatever it's called), I'd be happy to hear about those, but for what I'm doing I think I do need it to be an int.
thanks!

Share this post

Link to post

Share on other sites

yeah, I wasn't sure what word to use, but I *think* that's what I want to do...basically I couldn't do it by just plain inputting because (for reasons beyond my knowledge) it would get stuck on just the first number