Name

ios_base::fmtflags type — Formatting flags

Synopsis

typedef  . . .  fmtflags;
static const fmtflags boolalpha;
static const fmtflags dec;
static const fmtflags fixed;
static const fmtflags hex;
static const fmtflags internal;
static const fmtflags left;
static const fmtflags oct;
static const fmtflags right;
static const fmtflags scientific;
static const fmtflags showbase;
static const fmtflags showpoint;
static const fmtflags showpos;
static const fmtflags skipws;
static const fmtflags unitbuf;
static const fmtflags uppercase;
static const fmtflags adjustfield;
static const fmtflags basefield;
static const fmtflags floatfield;
image with no caption

The fmtflags type is an integer, enum, or bitmask type (the exact type is implementation-defined) that represents formatting flags for input and output. In the ios_base class, several static constants are also defined, which can be implemented as enumerated literals or as explicit constants. Table 13-13 lists the flag literals.

Table 13-13. fmtflags literals

Literal name

Description

boolalpha

Reads and writes bool values as text, according to the locale

dec

Reads and writes decimal integers

fixed

Writes floating-point values in fixed notation

hex

Reads and writes hexadecimal integers

internal

Aligns output to internal point (e.g., after sign or 0x)

left

Left-aligns output

oct

Reads and writes octal integers

right

Right-aligns output

scientific

Writes ...

Get C++ In a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.