Solved

cout.setf(ios::fixed)

Posted on 1997-03-02
1
1,202 Views
Last Modified: 2012-08-13
What means the next line

   cout setf(ios::fixed)
0
Comment
Question by:rene zinken
1 Comment
 

Accepted Solution

by:
radagast earned 50 total points
ID: 1162269
This chooses the "fixed" format for printing floating point numbers. The effect is that floating pointer numbers will be
printed in the format xxxx.yyy where the number of digits after
the point is given by 'precision()' and the total length of the output is given by 'width()'.
However, you should modify the statement to become
  cout.setf(ios::fixed, ios::floatfield);
to make sure that other format flags are properly cleared.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now