How to use std::fixed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • randysimes
    New Member
    • Oct 2009
    • 54

    How to use std::fixed

    I have the following output column header:
    Type Pass Cap Load Cap DOT License Serial Number
    ------ --------------- -------------- ------------------ ---------------------

    How would I use std::fixed to line up my output with the columns?
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    You wouldn't, std::fixed is about how floating point numbers are displayed, to set column widths use setw (and setprecision to limit digits in a floating point number, std::fixed effects how setprecision is interpreted).

    I suggest you read up on the IO Manipulators.

    Comment

    Working...