##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# fgetpos

From cppreference.com
< c‎ | io

Defined in header `<stdio.h>` |  |

int fgetpos( FILE *stream, fpos_t *pos ); |  | (until C99)
int fgetpos( FILE *restrict stream, fpos_t *restrict pos ); |  | (since C99)

Obtains the file position indicator for the file stream `stream` and stores it in `pos`.

### [edit] Parameters

stream | - | file stream to examine
pos | - | pointer to a fpos_t object to store the file position indicator to

### [edit] Return value

​0​ upon success, nonzero value otherwise.

### [edit] See also

ftell | returns the current file position indicator (function) [edit]
fseek | moves the file position indicator to a specific location in a file (function) [edit]
fsetpos | moves the file position indicator to a specific location in a file (function) [edit]
C++ documentation for fgetpos

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=c/io/fgetpos&oldid=66052"