##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# ftell

From cppreference.com
< c‎ | io

Defined in header `<stdio.h>` |  |
long ftell( FILE *stream ); |  |

Returns the file position indicator for the file stream `stream`.

If the stream is open in binary mode, the value obtained by this function is the number of bytes from the beginning of the file.

If the stream is open in text mode, the value returned by this function is unspecified and is only meaningful as the input to fseek().

### [edit] Parameters

stream | - | file stream to examine

### [edit] Return value

File position indicator on success or EOF if failure occurs.

On error, the errno variable is set to implementation-defined positive value.

### [edit] Example

| This section is incomplete Reason: no example

### [edit] See also

fgetpos | gets the 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 ftell

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

- Todo no example