C++ - ios_base openmode


Advertisements

Description

This is Bitmask type to represent stream opening mode flags.

A value of this type can be any valid combination of the following member constants as shown below −

member constant opening mode
app (append) Set the stream's position indicator to the end of the stream before each output operation.
ate (at end) Set the stream's position indicator to the end of the stream on opening.
binary (binary) Consider stream as binary rather than text.
in (input) Allow input operations on the stream.
out (output) Allow output operations on the stream.
trunc (truncate) Any current content is discarded, assuming a length of zero on opening.

These constants are defined in the ios_base class as public members. Therefore, they can be referred to either directly by their name as members of ios_base (like ios_base::in) or by using any of their inherited classes or instantiated objects, like for example ios::ate or cout.out.

ios.htm
Advertisements