Basically, these are two different ways to do the same thing: set the pointer to the beginning of the file. The only difference is that rewind also clears the error indicator.
If you need a choice, you should use fseek . This is because rewind does not return an integer indicating whether the operation succeeded.
user672118
source share