std::FILE(3)
std::FILE(3)
okay so this is std::FILE(3), straight out of the C++ Standard Libary β yes bestie, that spelling is in the header, and honestly? iconic. Itβs the C++ standard library page for the C stream type, and weβre gonna get into it. π«Ά
πΈ NAME πΈ
std::FILE - std::FILE
Thatβs the name, no notes. Itβs literally the type that represents a C stream in C++ land. π
β¨ Synopsis β¨
Defined in header <cstdio>, and the typedef is exactly this:
typedef /* unspecified */ FILE;
Each std::FILE object denotes a C stream. π«Ά
π technical caveat, bestie: the C standard (referenced by the C++ standard) does not specify whetherstd::FILEis a complete object type. While it may be possible to copy a validstd::FILE, using a pointer to such a copy as an argument for an I/O function invokes unspecified behavior. In other words,std::FILEmay 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 π
hereβs the squad:
basic_streambufabstracts a raw device (class template)basic_filebufimplements raw file device (class template)stdinexpression of typeFILE*associated with the input streamstdoutexpression of typeFILE*associated with the output streamstderrexpression of typeFILE*associated with the error output stream (macro constant)- C documentation for
FILE
thatβs the whole vibe π β source/version is http://cppreference.com, date 2024.06.10, and yes she ate. π«Άπ
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms