setw, width

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Marc Schellens

    setw, width

    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

    #2
    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


    Comment

    Working...