Namespaces
Variants
Views
Actions

C-style file input/output

From cppreference.com
< cpp | io
Revision as of 13:47, 15 June 2012 by P12bot (Talk | contribs)
 
 
 
 

The <cstdio> header provides generic file operation support and supplies functions with narrow character input/output capabilities.

The <cwchar> header supplies functions with wide character input/output capabilities.

Contents

Functions

Template:cpp/io/c/dcl list fopenTemplate:cpp/io/c/dcl list freopenTemplate:cpp/io/c/dcl list fcloseTemplate:cpp/io/c/dcl list fflushTemplate:cpp/io/c/dcl list fwideTemplate:cpp/io/c/dcl list setbufTemplate:cpp/io/c/dcl list setvbufTemplate:cpp/io/c/dcl list freadTemplate:cpp/io/c/dcl list fwriteTemplate:cpp/io/c/dcl list fgetcTemplate:cpp/io/c/dcl list fgetsTemplate:cpp/io/c/dcl list fputcTemplate:cpp/io/c/dcl list fputsTemplate:cpp/io/c/dcl list getcharTemplate:cpp/io/c/dcl list getsTemplate:cpp/io/c/dcl list putcharTemplate:cpp/io/c/dcl list putsTemplate:cpp/io/c/dcl list ungetcTemplate:cpp/io/c/dcl list fgetwcTemplate:cpp/io/c/dcl list fgetwsTemplate:cpp/io/c/dcl list fputwcTemplate:cpp/io/c/dcl list fputwsTemplate:cpp/io/c/dcl list getwcharTemplate:cpp/io/c/dcl list putwcharTemplate:cpp/io/c/dcl list ungetwcTemplate:cpp/io/c/dcl list fscanfTemplate:cpp/io/c/dcl list vfscanfTemplate:cpp/io/c/dcl list fprintfTemplate:cpp/io/c/dcl list vfprintfTemplate:cpp/io/c/dcl list fwscanfTemplate:cpp/io/c/dcl list vfwscanfTemplate:cpp/io/c/dcl list fwprintfTemplate:cpp/io/c/dcl list vfwprintfTemplate:cpp/io/c/dcl list ftellTemplate:cpp/io/c/dcl list fgetposTemplate:cpp/io/c/dcl list fseekTemplate:cpp/io/c/dcl list fsetposTemplate:cpp/io/c/dcl list rewindTemplate:cpp/io/c/dcl list clearerrTemplate:cpp/io/c/dcl list feofTemplate:cpp/io/c/dcl list ferrorTemplate:cpp/io/c/dcl list perrorTemplate:cpp/io/c/dcl list removeTemplate:cpp/io/c/dcl list renameTemplate:cpp/io/c/dcl list tmpfileTemplate:cpp/io/c/dcl list tmpnam
File access
Direct input/output
Unformatted input/output
Narrow character
Wide character
Formatted input/output
Narrow character
Wide character
File positioning
Error handling
Operations on files

Types

Defined in header <cstdio>
Type Definition
FILE type, capable of holding all information needed to control a C I/O stream
fpos_t type, capable of uniquely specifying a position in a file

Macros

Defined in header <cstdio>
stdin
stdout
stderr
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)
EOF
integer constant expression of type int and negative value
(macro constant)
FOPEN_MAX
number of files that can be open simultaneously
(macro constant)
FILENAME_MAX
size needed for an array of char to hold the longest supported file name
(macro constant)
BUFSIZ
size of the buffer used by std::setbuf
(macro constant)
_IOFBF
_IOLBF
_IONBF
argument to std::setbuf indicating fully buffered I/O
argument to std::setbuf indicating line buffered I/O
argument to std::setbuf indicating unbuffered I/O
(macro constant)
SEEK_SET
SEEK_CUR
SEEK_END
argument to std::fseek indicating seeking from beginning of the file
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
maximum number of unique filenames that can be generated by std::tmpnam
(macro constant)
L_tmpnam
size needed for an array of char to hold the result of std::tmpnam
(macro constant)