Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
I am a student , studying at home.
I have just begun C++ reference book by Sietel and dietel .
In coding an exercise , i am facing difficulty in getting the answer in decimal figures , although i am using data type " float ". code has been furtheer simplified just to indicate the problem.
The book tells to use an unfamiliar function
static_cast (total) / 3 ;
cout << " Average is " << setprecision (4)
<< setioflage(ios::fixed | ios::showpoint)
<< avg << end1 ;
Obviously , at this stage i do not know from where and how to get these data types , and their usage.
My Questios are :
1. Is there any other data type , that might give decimal answer?
2. where can I get above refered functions , and to know their
3. end1 --- command is not being supported by the Dev C++
version 188.8.131.52 ........... what is the alternative.
Thanking you .
0 · ·