Sets the file to its beginning.
#include <stdio.h> void rewind (FILE *file_ptr); (ISO POSIX-1) int rewind (FILE *file_ptr); (DEC C Extension)
A successful call to rewind clears the error indicator for the file.
The ANSI C standard defines rewind as not returning a value; therefore, the function prototype for rewind is declared with a return type of void. However, since a rewind can fail, and since previous versions of the DEC C RTL have declared rewind to return an int, the code for rewind does return 0 on success and -1 on failure.
See also fseek in this section.