ftell

From cppreference.com
< c‎ | io
 
 
File input/output


Functions
File access
Direct input/output
Unformatted input/output
(C95)(C95)
(C95)
(C95)(C95)
(C95)
(C95)
Formatted input
Formatted output
File positioning
ftell
Error handling
Operations on files
 
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().

Parameters

stream - file stream to examine

Return value

File position indicator on success or EOF if failure occurs.

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