|
From: Marton R. <mar...@ho...> - 2001-10-26 02:37:43
|
Hello all,
I'm a programming student currently in my C++ part 2 class.
Please tell me why the following code gives me errors with any of the three
commented floating point formatting code un-commented? I get errors with
three different compilers.
If anyone knows how to fix this please help. Or, if anyone knows another way
to format floating point data please help.
Thanks,
Marton D. Rusk
#include <iostream>
#include <iomanip>
using namespace std;
//cout << fixed << showpoint; //don't work
//cout.setf(ios::fixed, ios::floatfield); //don't work
//cout.setf(ios::showpoint);
//cout.setf(ios_base::fixed, ios_base::floatfield); //don't work
//cout.setf(ios_base::showpoint);
int main(){
float number = 3.57890;
cout << number;
return 0;
}
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
|