CrazyCoder
CrazyCoder

Reputation: 2605

Implementation of rewind(file offset) in c

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

Answers (1)

CommonSense
CommonSense

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

Related Questions