Sets the file position indicator to the beginning of the file.
#include <stdio.h> void rewind ( FILE *fp);
(IN) Points to the file.
The rewind function sets the file position indicator for the stream indicated by fp to the beginning of the file. It is equivalent to the following:
fseek( fp, 0L, SEEK_SET );
except that the error indicator for the stream is cleared.
If you want to determine if rewind encounters an error, clear errno and then call rewind. If errno is nonzero, assume an error has occurred.