Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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 fsetpos function sets the mbstate_t object (if any) and file position indicator for the stream pointed to by stream according to the value of the object pointed to by pos, which shall be a value obtained from an earlier successful call to the fgetpos function 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

...