The second syntax sets a new field width for the object.
The field width determines the minimum number of characters to be written in some output representations. If the standard width of the representation is shorter than the field width, the representation is padded with fill characters at a point determined by the format flag adjustfield (left, right or internal).
The fill character can be retrieved or changed by calling the member function ios::fill.
The format flag adjustfield can be modified by calling the member functions flags or setf, by inserting one of the following manipulators: left, right and internal, or by inserting the parameterized manipulator setiosflags.
The field width can also be modified using the parameterized manipulator setw.
- New value for the stream's field width. This is an integral value of type streamsize.
Return ValueThe value of the field width before the call.
100 100 100xxxxxxxxxxxx
|setw||Set field width (manipulator function)|
|ios_base::flags||Get/set format flags (public member function)|
|ios_base::setf||Set specific format flags (public member function)|
|ios::fill||Get/set the fill character (public member function)|