setw, width

M

Marc Schellens

Is there an defined standard behaviour if I set in
an iostream the field width to zero or to an negative value?
(ie. using the natural with of the output object or similar)
thanks,
marc
 
A

Attila Feher

Marc said:
Is there an defined standard behaviour if I set in
an iostream the field width to zero or to an negative value?
(ie. using the natural with of the output object or similar)

Zero seems to be the "natural width" in the standard. About negative
values... only a comment says that negative values are only used (for the
type streamwidth) in one case, and that is not width (or precision). I did
not read every page (it is huge) but it seems that all the standard says is
that width sets the minimum width. IMHO this means that negative numbers
should behave the same as 0, but I might be wrong.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,143
Messages
2,570,822
Members
47,368
Latest member
michaelsmithh

Latest Threads

Top