f78
The following methods control (or report on) settings for some details of controlling streams, primarily to do with formatting output.
char ios::fill ()const Method
Returns the current padding character.
char ios::fill (char padding) Method
Set the padding character.
You can also use the manipulator, setfill.
See Changing
stream properties using manipulators.
Default: space.
int ios::precision ()const Method
Report the number of significant
digits currently in use for output of floating point numbers.
Default: 6.
int ios::precision (int signif) Method
Set the number of significant digits (for input and output numeric conversions) to signif. You can also use the manipulator setprecision for this purpose. See Changing stream properties using manipulators.
int ios::width ()const Method
Report the current output
field width setting (the number of characters to write on the next <<
output operation).
Default: 0,
which means to use as many characters as necessary.
int ios::width (int num) Method
Set the input field width setting to num. Return the previous value for this stream. This value resets to zero (the default) every time you use <<; it is essentially an additional implicit argument to that operator. You can also use the manipulator setw for this purpose. See Changing stream properties using manipulators.
fmtflags ios::flags ()const Method
Return the current value of the complete collection of flags controlling the format state. The following are the flags and their meanings when set.
fmtflags ios::flags (fmtflags value) Method
Set value as the complete
collection of flags controlling the format state. The flag values are described
under ios::flags
().
Use ios::setf
or ios::unsetf
to change one property at a time.
fmtflags ios::setf (fmtflags flag) Method
Set one particular flag (of those described for ios::flags(); return the complete collection of flags previously in effect. (Use ios::unsetf to cancel.)
fmtflags ios::setf (fmtflags flag, fmtflags mask) Method
Clear the flag values indicated by mask, then set any of them that are also in flag. (Flag values are described for ios::flags ().) Return the complete collection of flags previously in effect. (See ios::unsetf for another way of clearing flags.)
fmtflags ios::unsetf (< 372 /FONT>fmtflags flag) Method
Make certain flag (a combination of flag values described for ios::flags ()) is not set for this stream; converse of ios::setf. Returns the old values of those flags.