Namespaces
Variants
Views
Actions

std::ios_base::width

From cppreference.com
< cpp‎ | io‎ | ios base
Revision as of 05:32, 4 July 2013 by P12 (Talk | contribs)

streamsize width() const;
(1)
streamsize width( streamsize new_width );
(2)

Manages the minimum number of characters to generate on certain output operations and the maximum number of character to generate on certain input operations.

1) Returns the current field width.
2) Sets the field width to the given one.

Contents

Parameters

new_width - new field width setting

Return value

The field width before the call to the function

Notes

Some I/O functions call width(0) before returning, see std::setw.

Example

See also

manages decimal precision of floating point operations
(public member function) [edit]