function
<cstdio>
fsetposint fsetpos ( FILE * stream, const fpos_t * pos );
Set position indicator of stream
Restores the current position in the stream to pos.The internal file position indicator associated with stream is set to the position represented by pos, which is a pointer to an fpos_t object whose value shall have been previously obtained by a call to fgetpos.
The end-of-file internal indicator of the stream is cleared after a successful call to this function, and all effects from previous calls to ungetc on this stream are dropped.
On streams open for update (read+write), a call to fsetpos allows to switch between reading and writing.
A similar function, fseek, can be used to set arbitrary positions on streams open in binary mode.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* fsetpos example */
#include <stdio.h>
int main ()
{
FILE * pFile;
fpos_t position;
pFile = fopen ("myfile.txt","w");
fgetpos (pFile, &position);
fputs ("That is a sample",pFile);
fsetpos (pFile, &position);
fputs ("This",pFile);
fclose (pFile);
return 0;
}
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4