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


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


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