Returns the position of a stream.
long ftell (FILE * stream);
Required Header |
<stdio.h> |
Return Value
This function returns the current file position within the stream. -1 indicates an error.
Parameters
stream
A pointer to the open FILE structure
Remarks
The ftell function returns the internal character counter for stream which may not represent the number of bytes used by the file when text translation mode has been chosen. Any padding added, to complete records, is not counted in the return value. When the file remains in the same mode, the result returned will reposition to the correct location when used with the fseek function.