< cpp‎ | io‎ | c
Revision as of 23:01, 31 May 2013 by P12bot (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Defined in header <cstdio>
int fsetpos( std::FILE* stream, const std::fpos_t* pos );

Sets the file position indicator and the multibyte parsing state (if any) for the C file stream stream according to the value pointed to by pos.

Besides establishing new parse state and position, a call to this function undoes the effects of std::ungetc and clears the end-of-file state, if it is set.

If a read or write error occurs, the error indicator (std::ferror)for the stream is set.

[edit] Parameters

stream - file stream to modify
pos - pointer to a fpos_t object obtained from std::fgetpos called on a stream associated with the same file

[edit] Return value

0 upon success, nonzero value otherwise. Also, sets errno on failure.

[edit] See also

gets the file position indicator
(function) [edit]
returns the current file position indicator
(function) [edit]
moves the file position indicator to a specific location in a file
(function) [edit]
C documentation for fsetpos