std::fseek

From Cppreference

< cpp | io | c
Jump to: navigation, search
Defined in header <cstdio>

int fseek( FILE *stream, long offset, int origin );

Sets the file position indicator for the file stream stream to the value pointed to by pos. This function can be used to set the indicator beyond the actual end of the file, however, negative position values are not accepted.

[edit] Parameters

stream - file stream to modify
origin - position to which offset is added. It can have one of the following values,

{{param list item | offset | number of characters to shift the position relative to origin

[edit] Return value

0 upon success, nonzero value otherwise. Associated EOF flag is cleared for the stream.

[edit] See also

fsetpos
moves the file position indicator to a specific location in a file
(function)
fgetpos
gets the file position indicator
(function)
ftell
returns the current file position indicator
(function)
rewind
moves the file position indicator to the beginning in a file
(function)