cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
user name:
password:
Forgot your password?
please wait
try again
cancel
forgot your password?
sign up
log in
[Legacy version]
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
cout.setf(ios::fixed)
cout.setf(ios::fixed)
Feb 24, 2009 at 4:28am
Feb 24, 2009 at 4:28am UTC
masiht
(222)
cout.setf(ios::fixed)
please tell me what is this and why do we use this ?
Feb 24, 2009 at 5:11am
Feb 24, 2009 at 5:11am UTC
Zhuge
(4664)
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
Feb 24, 2009 at 6:18am UTC
masiht
(222)
how do we know that we have to use this ?
Feb 24, 2009 at 6:23am
Feb 24, 2009 at 6:23am UTC
Zhuge
(4664)
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.