The rewind( ) function resets the file position indicator to the beginning of the file specified as its arguments. That is, it “rewinds” the file. Its protype is
void rewind(FILE *fp);
where fp is a valid file pointer.
In Example 1 and Example 3 the rewind () function is used after input is complete to move file position indicator at the beginning so that data can be read from the beginning.