Namespaces
Variants
Views
Actions

File input/output

From cppreference.com
< c
Revision as of 22:00, 2 November 2012 by P12bot (Talk | contribs)

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

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

Contents

Functions

Template:c/io/dcl list fopenTemplate:c/io/dcl list freopenTemplate:c/io/dcl list fcloseTemplate:c/io/dcl list fflushTemplate:c/io/dcl list fwideTemplate:c/io/dcl list setbufTemplate:c/io/dcl list setvbufTemplate:c/io/dcl list freadTemplate:c/io/dcl list fwriteTemplate:c/io/dcl list fgetcTemplate:c/io/dcl list fgetsTemplate:c/io/dcl list fputcTemplate:c/io/dcl list fputsTemplate:c/io/dcl list getcharTemplate:c/io/dcl list getsTemplate:c/io/dcl list putcharTemplate:c/io/dcl list putsTemplate:c/io/dcl list ungetcTemplate:c/io/dcl list fgetwcTemplate:c/io/dcl list fgetwsTemplate:c/io/dcl list fputwcTemplate:c/io/dcl list fputwsTemplate:c/io/dcl list getwcharTemplate:c/io/dcl list putwcharTemplate:c/io/dcl list ungetwcTemplate:c/io/dcl list fscanfTemplate:c/io/dcl list vfscanfTemplate:c/io/dcl list fprintfTemplate:c/io/dcl list vfprintfTemplate:c/io/dcl list fwscanfTemplate:c/io/dcl list vfwscanfTemplate:c/io/dcl list fwprintfTemplate:c/io/dcl list vfwprintfTemplate:c/io/dcl list ftellTemplate:c/io/dcl list fgetposTemplate:c/io/dcl list fseekTemplate:c/io/dcl list fsetposTemplate:c/io/dcl list rewindTemplate:c/io/dcl list clearerrTemplate:c/io/dcl list feofTemplate:c/io/dcl list ferrorTemplate:c/io/dcl list perrorTemplate:c/io/dcl list removeTemplate:c/io/dcl list renameTemplate:c/io/dcl list tmpfileTemplate:c/io/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 <stdio.h>
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 <stdio.h>
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 setbuf()
(macro constant)
_IOFBF
_IOLBF
_IONBF
argument to setvbuf() indicating fully buffered I/O
argument to setvbuf() indicating line buffered I/O
argument to setvbuf() indicating unbuffered I/O
(macro constant)
SEEK_SET
SEEK_CUR
SEEK_END
argument to fseek() indicating seeking from beginning of the file
argument to fseek() indicating seeking from the current file position
argument to fseek() indicating seeking from end of the file
(macro constant)
TMP_MAX
maximum number of unique filenames that can be generated by tmpnam()
(macro constant)
L_tmpnam
size needed for an array of char to hold the result of tmpnam()
(macro constant)