C Language: rewind function(Rewind File)

In the C Programming Language, the rewind function sets the file position to the beginning of the file for the stream pointed to by stream. It also clears the error and end-of-file indicators for stream.


The syntax for the rewind function in the C Language is:

void rewind(FILE *stream);

Parameters or Arguments


The stream whose file position indicator is to be set to the beginning of the file.


The rewind function does not return anything.

Required Header

In the C Language, the required header for the rewind function is:

#include <stdio.h>

Applies To

In the C Language, the rewind function can be used in the following versions:

  • ANSI/ISO 9899-1990

stdio.h Functions