Namespaces
Variants
Views
Actions

std::ftell

From cppreference.com
< cpp‎ | io‎ | c
 
 
Input/output library
I/O manipulators
C-style I/O
Buffers
(deprecated in C++98)
Streams
Abstractions
File I/O
String I/O
Array I/O
(deprecated in C++98)
(deprecated in C++98)
(deprecated in C++98)
Synchronized Output
Types
Error category interface
(C++11)
 
 
Defined in header <cstdio>
long ftell( std::FILE* stream );

Returns the current value of 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 std::fseek

Contents

[edit] Parameters

stream - file stream to examine

[edit] Return value

File position indicator on success or -1L if failure occurs. Also sets errno on failure.

[edit] Example

[edit] See also

gets the file position indicator
(function) [edit]
moves the file position indicator to a specific location in a file
(function) [edit]
moves the file position indicator to a specific location in a file
(function) [edit]
returns the input position indicator
(public member function of std::basic_istream) [edit]
returns the output position indicator
(public member function of std::basic_ostream) [edit]
C documentation for ftell