Page 1 of 1

fixed

Posted: Tue Sep 20, 2005 8:41 pm
by Charles256
what could possibly be wrong with ...

Code: Select all

cout << setprecision(2) << fixed;
yes i did include iomanip....
this is the error I gget...
:\Documents and Settings\Owner\Desktop\Program3\Program3\Program3.cpp(29) : error C2065: 'fixed' : undeclared identifier

Posted: Tue Sep 20, 2005 8:49 pm
by feyd
fixed is defined in ios

Code: Select all

#include <ios>

Posted: Tue Sep 20, 2005 8:51 pm
by Charles256
is my c++ book that old? :o

Posted: Tue Sep 20, 2005 8:52 pm
by Charles256
actually that didn't fix it..hmm..

Posted: Tue Sep 20, 2005 9:00 pm
by Charles256
i fixed it.had to change my includes, remove the .h's and declare using namespace std; and that fixed it.

Posted: Tue Sep 20, 2005 9:06 pm
by feyd
yeah.. this works for me....

Code: Select all

#include <iostream>
#include <iomanip>

using namespace std;

void main() {
	cout << setprecision(2) << fixed;
}