delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/10/05:42:20

Newsgroups: comp.os.msdos.djgpp
From: manni DOT heumann AT gmx DOT de (Manni Heumann)
Subject: Re: Help /w setting flags in DJGPP V2.03
References: <0jSiOBNKEJft98TO9fks5mc=53xA AT 4ax DOT com>
X-Newsreader: News Xpress 2.01
Date: Thu, 10 Feb 2000 09:18:11 GMT
NNTP-Posting-Host: dhcp33-226.uni-bielefeld.de
Message-ID: <38a28256_1@news.uni-bielefeld.de>
X-Trace: 10 Feb 2000 10:18:14 +0200, dhcp33-226.uni-bielefeld.de
Lines: 31
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

In article <0jSiOBNKEJft98TO9fks5mc=53xA AT 4ax DOT com>, Buddy_Rich <BRich AT mail DOT com> 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'm not sure what solution is closer to the standard. But here is, what I 
would do in DJGPP c++:

file.setf (ios::fixed, ios::floatfield); // Sets the bit "fixed" in 
"floatfield"

file.precision (2); // Is self-explanatory.


--

Manni

- Raw text -


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