Reputation: 2605
Can anyone explain the implementation/algo that was used in rewind function? or is it possible to implement rewind function using lseek()?
Upvotes: 0
Views: 1066
Reputation: 333
Here's a quote from a reference:
A call to rewind is equivalent to:
fseek ( stream , 0L , SEEK_SET );
except that, unlike fseek, rewind clears the error indicator.
http://www.cplusplus.com/reference/clibrary/cstdio/rewind/
Upvotes: 4