The C++ <cstdio> header provides generic file operation support and defines a number of functions with narrow and multibyte character input/output capabilities, and the <cwchar> header provides functions with wide character input/output capabilities. These functions are available to use in a current program after including the header file using - #include <cstdio> or #include <stdio.h>. Functions and macros of this header file are listed below:
Functions | Description |
fprintf() |
Writes formatted data to stream. |
fscanf() |
Reads formatted data from stream. |
Functions | Description |
fgetpos() |
Gets the current file position indicator. |
fseek() |
Moves the file position indicator to a specific location. |
fsetpos() |
Sets the file position indicator to a specific location. |
ftell() |
Returns the current file position indicator. |
rewind() |
Sets the file position indicator to the beginning. |
Functions | Description |
clearerr() |
Clear error indicators. |
feof() |
Check end-of-file indicator. |
ferror() |
Checks for a file error. |
Types | Description |
FILE |
Object type, capable of holding all information needed to control a stream. |
fpos_t |
Object containing information to specify a position within a file. |
size_t |
Unsigned integer type. |
Macros | Description |
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. |
Macros | Description |
BUFSIZ |
Buffer size. |
EOF |
End-of-File. |
FILENAME_MAX |
Maximum length of file names. |
FOPEN_MAX |
Number of files that can be open simultaneously. |
L_tmpnam |
Size needed for an array of char to hold the result of tmpnam(). |
NULL |
Null pointer. |
TMP_MAX |
Maximum number of unique filenames that is guaranteed to be possible to generate using tmpnam(). |
SEEK_SET SEEK_CUR SEEK_END |
Argument to fseek() indicating seeking from beginning of the file, from the current file position, and from end of the file respectively. |