|
fsetposfunction
<cstdio> int fsetpos ( FILE * stream, const fpos_t * pos ); Set position indicator of stream Changes the internal file position indicator associated with stream to a new position. The position parameter is a pointer to an fpos_t object whose value shall have been previously obtained with a call to fgetpos.The End-of-File internal indicator of the stream is cleared after a call to this function, and all effects from previous calls to ungetc are dropped. On streams open for update (read+write), a call to fsetpos allows to switch between reading and writing. Parameters
Return ValueIf successful, the function returns a zero value.Otherwise, it returns a nonzero value and sets the global variable errno to a positive value, which can be interpreted with perror. Example
After this code is successfully executed, a file called myfile.txt will contain: This is a sample See also
|