Repositions the file pointer to the beginning of a file and clears the end-of-file indicator.
#include <stdio.h> void rewind (FILE *stream);
stream
A call to rewind is nearly equivalent to:
(void) fseek (stream, 0L, SEEK_SET);
rewind clears the error indicators for the stream; fseek does not. fseek returns a value that indicates whether the pointer was successfully moved; rewind does not.
You can use rewind to clear the keyboard buffer. Specify stdin, associated with the keyboard by default, as stream.
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 3.0 | intime/rt/include/stdio.h | stdio.h | clib.lib |