Standard C++ Library Reference ISO/IEC (VERSION3)
file-position indicator is positioned at the end of the file (possibly after arbitrary null byte
padding) before each write
"r+" -- to open an existing text file for reading and writing●
"w+" -- to create a text file or to open and truncate an existing text file, for reading and
writing
●
"a+" -- to create a text file or to open an existing text file, for reading and writing. The
file-position indicator is positioned at the end of the file before each write
●
"r+b" or "rb+" -- to open an existing binary file for reading and writing●
"w+b" or "wb+" -- to create a binary file or to open and truncate an existing binary file,
for reading and writing
●
"a+b" or "ab+" -- to create a binary file or to open an existing binary file, for reading
and writing. The file-position indicator is positioned at the end of the file (possibly after
arbitrary null byte padding) before each write
●
If you open a file for both reading and writing, the target environment can open a binary file
instead of a text file. If the file is not interactive, the stream is fully buffered.
FOPEN_MAX
#define FOPEN_MAX <integer constant expression >= 8>
The macro yields the maximum number of files that the target environment permits to be
simultaneously open (including stderr, stdin, and stdout).
fpos_t
typedef o-type fpos_t;
The type is an object type o-type of an object that you declare to hold the value of a
file-position indicator stored by fsetpos and accessed by fgetpos.
fprintf
int fprintf(FILE *stream, const char *format, ...);
The function generates formatted text, under the control of the format format and any
additional arguments, and writes each generated character to the stream stream. It returns the
number of characters generated, or it returns a negative value if the function sets the error
indicator for the stream.