Scroll to navigation

std::FILE(3) C++ Standard Libary std::FILE(3)

NAME

std::FILE - std::FILE

Synopsis


Defined in header <cstdio>
typedef /* unspecified */ FILE;


Each std::FILE object denotes a C stream.


C standard (referenced by C++ standard) does not specify whether std::FILE is a
complete object type. While it may be possible to copy a valid std::FILE, using a
pointer to such a copy as an argument for an I/O function invokes unspecified
behavior. In other words, std::FILE may be semantically non-copyable.


I/O streams can be used for both unformatted and formatted input and output.
Furthermore, the functions that handle input and output can also be
locale-sensitive, such that wide/multibyte conversions are performed as necessary.

Notes


POSIX explicitly requires that the LC_CTYPE facet of the currently installed C
locale be stored within the FILE object the moment the stream's orientation becomes
wide; POSIX requires that this LC_CTYPE facet be used for all future I/O on this
stream until the orientation is changed, regardless of any subsequent call to
std::setlocale.


It is intended that each line of text be composed of data that are essentially
human-readable. POSIX implementations do not distinguish between text and binary
streams (there is no special mapping for '\n' or any other characters).

See also


basic_streambuf abstracts a raw device
(class template)
basic_filebuf implements raw file device
(class template)
stdin expression of type FILE* associated with the input stream
stdout expression of type FILE* associated with the output stream
stderr expression of type FILE* associated with the error output stream
(macro constant)
C documentation for
FILE

2024.06.10 http://cppreference.com