C-style file input/output
From cppreference.com
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Input/output library
Print functions (C++23)
C-style I/O
Buffers
(C++23)
(C++98/26*)
(C++20)
Streams
Abstractions
File I/O
String I/O
Array I/O
(C++23)
(C++23)
(C++23)
(C++98/26*)
(C++98/26*)
(C++98/26*)
Synchronized Output
(C++20)
Types
Error category interface
(C++11)
(C++11)
C-style I/O
Types and objects
Functions
File access
Direct input/output
Unformatted input/output
Formatted input
(C++11)(C++11)(C++11)
(C++11)(C++11)(C++11)
Formatted output
(C++11)
(C++11)
File positioning
Error handling
Operations on files
The C I/O subset of the C++ standard library implements C-style stream input/output operations. The <cstdio> header provides generic file operation support and supplies functions with narrow and multibyte character input/output capabilities, and the <cwchar> header provides functions with wide character input/output capabilities.
C streams are denoted by objects of type std::FILE that can only be accessed and manipulated through pointers of type std::FILE *. Each C stream is associated with an external physical device (file, standard input stream, printer, serial port, etc).
[edit] Types
Defined in header
<cstdio>
complete non-array object type, capable of uniquely specifying a position in a file, including its multibyte parse state
(typedef) [edit]
(typedef) [edit]
[edit] Predefined standard streams
Defined in header
<cstdio>
expression of type FILE* associated with the input stream
expression of type FILE* associated with the output stream
expression of type FILE* associated with the error output stream
(macro constant) [edit]
expression of type FILE* associated with the output stream
expression of type FILE* associated with the error output stream
(macro constant) [edit]
[edit] Functions
Defined in header
<cstdio>
File access
Direct input/output
Unformatted input/output
Byte/multibyte character
Wide character
Formatted input/output
Byte/multibyte character
(C++11)(C++11)(C++11)
using variable argument list
(function) [edit]
(C++11)
using variable argument list
(function) [edit]
Wide character
(C++11)(C++11)(C++11)
or a buffer using variable argument list
(function) [edit]
prints formatted wide character output to stdout , a file stream
or a buffer using variable argument list
(function) [edit]
or a buffer using variable argument list
(function) [edit]
File positioning
Error handling
Operations on files
[edit] Macro constants
Defined in header
<cstdio>
EOF
(macro constant)
FOPEN_MAX
(macro constant)
FILENAME_MAX
(macro constant)
_IOFBF_IOLBF_IONBF
argument to std::setbuf indicating line buffered I/O
argument to std::setbuf indicating unbuffered I/O
(macro constant)
SEEK_SETSEEK_CURSEEK_END
argument to std::fseek indicating seeking from the current file position
argument to std::fseek indicating seeking from end of the file
(macro constant)
TMP_MAX
(macro constant)
[edit] See also
C documentation for File input/output