What does cout.setf (ios::fixed | iso:: showpoint); and cout.precision(4) means in a c++ code?

 Dont Buy Textbooks. Rent 'EM Save 60-80%



What does cout.setf (ios::fixed | iso:: showpoint); and cout.precision(4) means in a c++ code.

What does cout.setf (ios::fixed | iso:: showpoint); and cout.precision(4) means in a c++ code?c++ compiler



those are flags for your output. cout.setf is a function to set the flags

ios::fixed - Display floating point values using normal notation (as opposed to scientific)

ios::showpoint - Display a decimal and extra zeros, even when not needed.

cout.setprecision(4) is limiting the precision of your number to 4 decimal places. so if you had a double d = 3.14159 and you did a cout.setprecision(4) you would get 3.142

What does cout.setf (ios::fixed | iso:: showpoint); and cout.precision(4) means in a c++ code?c++ cli



chinga tu madre|||i have no idea. I learned a lil bit of C++ 1 and half year ago. right now, I can remember nothing but "#include"|||hello!

setf means that you will set the flag. fixed means that to display real values in a fixed notation and showpoint is to display a trailing decimal point and trailing decimal zeros when real numbers are displayed. and last precision means you set the output into 4 decimal places.

hope that would help. God bless! =)



More Related Questions and Answers ...
  • What is the php equivalent of cout>> in..
  • Why the following statement executing once in..
  • In C/C++, is printf faster than cout?
  • Does anyone knows what does the C in the clas..
  • In C++ How would i cout text to say wordpad?
  • Write a C/C++ program which consists of a use..
  • C dac courses in hyderabad.its cost its detai..
  • Does defendant kenneth c dugan, have a crimin..
  • How can I get Borland C++ to output a string ..
  • How do I use cout an cin in a visual C++ 2005..
  • Help for computer c++ project banking?
  • C++ Have problem when im executing my code (M..
  • Please help!!! C++ user defined funtions?
  • Does anyone know some good colleges/universit..
  • C++..program runs fine but with errors in the..
  • How to write pseudo code in c++ program. what..
  • Urgent C++ Help?
  • Beginner C++ Help?
  • Help with C++ Program ?

  • The information post by website user , we not guarantee correctness.

    

    Dental Treatment Skin Whitening Skin Problems Skin Rashes Shoes