Declaration:
long ftell(unsigned long stream);
Description
Returns the current file pointer.
ftell returns the current file pointer for stream. The offset is measured in bytes from the beginning of the file (for the binary file). The value returned by ftell can be used in the subsequent call to fseek.
Returned Value
on success ftell returns the current file pointer position. It returns -1L on error and sets the errno global variable to a positive value. In the event of error return, the errno global variable is set to one of the following values:
EBADF Bad file pointer
ESPIPE Illegal seek on device
|