prototype
void rewind(FILE* stream)
description
Repositions the file pointer to the beginning of a stream.
Sets the file pointer associated with the stream to the beginning of the file.
A call to rewind is equivalent to:
fseek ( stream , 0L , SEEK_SET );
except that unlike fseek, using rewind the error indicator is cleared.
The next operation with the stream after a call to fseek can be either for input or output.
This function is also useful for clearing the keyboard buffer (normally associated with stdin).
parameters
- stream
Pointer to an open file.