This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: fixed in output stream not recognized


Hi Frank,

Worked for me.  Hmmm.

#include <iomanip>
  using std::fixed;

#include <fstream>
  using std::ofstream;

#include <string>
  using std::string;

void Foo(const string& filename) {
  double d = 3.3;
  ofstream file(filename.c_str());
  file.precision(0);
  file << fixed << d;
}

--Eljay


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]