Hey guys,
I've been having some trouble setting ios:: flags. In general I don't use using
, but without it what I do doesn't work.
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
double moneys = 5.2;
cout << "$" << moneys << "\n" << "$";
cout << setiosflags(ios::fixed) << setprecision(2) << moneys;
return 0;
}
#if (0)
#include <iostream>
#include <iomanip>
int main() {
double moneys = 5.2;
std::cout << "$" << moneys << "\n" << "$";
std::cout << std::setiosflags(ios::fixed) << std::setprecision(2) << moneys;
return 0;
}
#endif
First part does what I want done, #if block is my attempt without using
and doesn't work. Any tips?