From -445725712862457546
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,a91346c8d4a685df
X-Google-Attributes: gidf78e5,public
From: Dietmar Kuehl <dietmar.kuehl@claas-solutions.de>
Subject: Re: cout.setf(0,ios_base::floatfield)
Date: 1999/12/07
Message-ID: <82j7pv$bp1$1@nnrp1.deja.com>#1/1
X-Deja-AN: 557760550
Approved: Fergus Henderson <fjh@cs.mu.oz.au>
References: <384BBA30.BA79A2F3@ibk.baum.ethz.ch>
X-Original-Date: Tue, 07 Dec 1999 15:06:44 GMT
X-Http-User-Agent: Mozilla/4.06 [de] (WinNT; I)
X-Complaints-To: news@news.unimelb.edu.au
X-Http-Proxy: 1.0 ffm2-tux.atm-bb.de:3228 (Squid/2.1.PATCH1), 1.0 x40.deja.com:80 (Squid/1.1.22) for client 212.81.239.27, 62.104.196.134
X-Trace: ariel.ucs.unimelb.edu.au 944585293 27017 128.250.37.153 (7 Dec 1999 16:48:13 GMT)
Organization: Deja.com - Before you buy.
X-Article-Creation-Date: Tue Dec 07 15:06:44 1999 GMT
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUAOE06YuEDnX0m9pzZAQHm5wF/RYW8aaOYjmaNSAccxavegLkpGlXVIXOT borlXvmEzXcFT694pC8U9eksgss5nWxP =usBa
X-Mydeja-Info: XMYDJUIDdietmar_kuehl
NNTP-Posting-Date: 7 Dec 1999 16:48:13 GMT
Newsgroups: comp.std.c++

Hi,
In article <384BBA30.BA79A2F3@ibk.baum.ethz.ch>,
  Benedikt Weber <weber@ibk.baum.ethz.ch> wrote:
> In Stroustrup 3rd Ed. on page 628 there is the example:
>
>        cout.setf (0,ios_base::floatfield)  //  reset cout to default

This example is wrong. It should be

  std::cout.setf(std::ios_base::fmtflags(0), std::ios_base::floatfield);

The important portion is the conversion to the type 'fmtflags' if it is
necessary, ie. if an implementation choose to use a different type than
'int', eg. an enum (like eg. my implementation does).
--
<mailto:dietmar.kuehl@claas-solutions.de>
homepage: <http://www.informatik.uni-konstanz.de/~kuehl>


Sent via Deja.com http://www.deja.com/
Before you buy.
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]



