This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: fixed in output stream not recognized
- From: LLeweLLyn Reese <llewelly at lifesupport dot shutdown dot com>
- To: John Love-Jensen <eljay at adobe dot com>
- Cc: Frank <fgeck at optonline dot net>, GNU GCC help list <gcc-help at gcc dot gnu dot org>
- Date: 26 Mar 2003 12:21:57 -0800
- Subject: Re: fixed in output stream not recognized
- References: <BAA76669.7E33%eljay@adobe.com>
John Love-Jensen <eljay at adobe dot com> writes:
> Hi Frank,
>
> Worked for me. Hmmm.
Using gcc 2.96 ? I don't think so. It certainly doesn't work on my
gcc 2.96 (i586-mandrake-linux-gnu).
It does work on 3.x, however, as the OP noted - but 2.96 didn't
support it.
>
> #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