| Wiki Markup |
|---|
Calling {{fsetpos()}} sets the file position indicatorSection 7.19.9.3 of aC99 filedefines stream.the following Accordingbehavior to C99for {{fsetpos()}}: \[[ISO/IEC 9899:1999|AA. C References#ISO/IEC 9899-1999]\], the only values that are correct for the position parameter for {{fsetpos()}} are values returned from the {{fgetpos()}}. Using any other values will result in [undefined behavior|BB. Definitions#undefined behavior] and should be |
The
fsetposfunction sets thembstate_tobject (if any) and file position indicator for the stream pointed to bystreamaccording to the value of the object pointed to bypos, which shall be a value obtained from an earlier successful call to thefgetposfunction on a stream associated with the same file.
Consequently, using any other values for pos will result in undefined behavior and should be avoided.
Non-Compliant Code Example
...