delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/10/13:18:59

Message-ID: <38A264D1.53C9CE6B@home.com>
From: Robin Johnson <robbat2 AT home DOT com>
Organization: Orbit Computers
X-Mailer: Mozilla 4.5 [en]C-AtHome0405 (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Help /w setting flags in DJGPP V2.03
References: <0jSiOBNKEJft98TO9fks5mc=53xA AT 4ax DOT com>
Lines: 36
Date: Thu, 10 Feb 2000 07:12:12 GMT
NNTP-Posting-Host: 24.113.36.103
X-Complaints-To: abuse AT home DOT net
X-Trace: news1.rdc1.bc.home.com 950166732 24.113.36.103 (Wed, 09 Feb 2000 23:12:12 PST)
NNTP-Posting-Date: Wed, 09 Feb 2000 23:12:12 PST
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Buddy_Rich wrote:

> I have the latest version of DJGPP from Delorie.com , v2.03.
>
> Anyways I can't set output flags for a file
>
> I code   file.setf(ios::showpoint, ios::fixed);
>              file.setf(ios::floatfield);
>
>              file << setprecision(2);
>
> With these flags my output shouldn't be in scientific notation and my
> precision is to 2 decimal places.  It compilies cleanly yet my output
> file still shows scientific notation.
>
> I am thinking I might not have installed DJGPP right, since the same
> code works in Borland at school.  Was my seting of flags Borland
> specific?

I  came across this in a class at school as well, but I have noticed that
the Borland code is the only one that works
line any book says, as DJGPP and MSVC produce identical output for this.
I found out by trial and error
that the member function unsetf is the solution to the problem, try it
first, and then see what output you get.

--
Robin Hugh Johnson
"Robbat2"
QTOD: "I used to be an idealist, but I got mugged by reality."
E-Mail     : robbat2 AT robbat2 DOT t-p-l DOT com
ICQ#       : 30269588 or 41961639
Home Page  : http://robbat2.t-p-l.com
Time Zone  : Pacific Daylight (GMT - 8)


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019