Connecting Tech Pros Worldwide Forums | Help | Site Map

setw, width

Marc Schellens
Guest
 
Posts: n/a
#1: Jul 19 '05
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


Attila Feher
Guest
 
Posts: n/a
#2: Jul 19 '05

re: setw, width


Marc Schellens wrote:[color=blue]
> 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)[/color]

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.

--
Attila aka WW


Closed Thread