Solved

cout.setf(ios::fixed)

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

   cout setf(ios::fixed)
0
Comment
Question by:rene zinken
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

756 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