cout.setf(ios::fixed)

Feb 24, 2009 at 4:28am
cout.setf(ios::fixed)
please tell me what is this and why do we use this ?
Feb 24, 2009 at 5:11am
This makes cout display floating point values in fixed point notation.

http://en.wikipedia.org/wiki/Fixed-point_arithmetic
Feb 24, 2009 at 6:18am
how do we know that we have to use this ?
Feb 24, 2009 at 6:23am
Well, that would depend on what type of display you want. Usually a floating point display looks fine but a fixed point display can be useful if you want all the decimal points to line up with a mono spaced font.
Topic archived. No new replies allowed.