Richard Heathfield said:
Olaf "El Blanco" said:
I've never done that in my life.
Think about what it would mean.
puts("Dear user: I know you have just spent the last twenty");
puts("minutes typing in all that stuff, and I thank you for");
puts("it - but now I'd like you to do it all again, EXACTLY");
puts("THE SAME as you did it last time.");
rewind(stdin);
I don't see that program lasting through to a second run.
[...]
If stdin is coming from an interactive device, rewind()ing it doesn't
make much sense. But if it's coming from, say, a disk file, then
rewind() *might* be a sensible thing to do.
However, the source from which stdin receives its input is generally
outside the control of the program. The rewind() function has its
uses, but if you're going to need to rewind() something, it should
probably be a named file (opened with fopen()), not stdin.