Namespaces
Variants
Views
Actions

std::ios_base::width

From cppreference.com
< cpp‎ | io‎ | ios base
Revision as of 15:21, 5 April 2013 by Cubbi (Talk | contribs)

Template:ddcl list begin <tr class="t-dcl-sep"><td></td><td></td><td></td></tr>

<tr class="t-dcl ">

<td >
streamsize width() const;
</td>

<td > (1) </td> <td class="t-dcl-nopad"> </td> </tr> <tr class="t-dcl-sep"><td></td><td></td><td></td></tr>

<tr class="t-dcl ">

<td >
streamsize width( streamsize new_width );
</td>

<td > (2) </td> <td class="t-dcl-nopad"> </td> </tr> Template:ddcl list end

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

Template:cpp/io/ios base/dcl list precision