Article View: gnu.gcc.help
Article #49710char char_tmp; if (char_tmp == 'i') {...} and setprecision(16) ???
From: Mingzuo Shen
Date: Thu, 30 Dec 1993 18:53
Date: Thu, 30 Dec 1993 18:53
40 lines
1791 bytes
1791 bytes
Hi all,
For the following, g++ -Wall complains that I attempt to
compare an unsigned and a signed:
char char_tmp;
if (char_tmp == 'i') { ...}
But g++ -Wall does not complain when given the following:
char char_tmp;
char ichar = 'i';
if (char_tmp == ichar) { ... }
Why?
Question No. 2: I read a C++ book intended for Borland C++
that there is a way to make `cout <<' print more digits for
doubles. But the book did not give an example. When I tried
the following, g++ says cout::setprecision is not <something>
double dtmp;
cout.setprecision(16);
cout << dtmp;
So how can I get more than 6 significant digits without using
%16f?
Question No. 3. The same book says there is a ws manipulator.
Does this strip white spaces from the istream? The following did
not compile under g++:
char line_input[MAX_LINE_LENGTH];
cin.ws();
cin.getline(line_input, MAX_LINE_LENGTH);
So is there is a built-in method to strip all white spaces from line_input?
Many thanks in advance. Email preferred. Mingzuo Shen
Technical Details
Message-ID:
<2fv83l$gd0@athena.cs.uga.edu>Path:
arc1-ca.pugleaf.net!gmd.de!xlink.net!sol.ctr.columbia.edu!howland.reston.ans.net!gatech!news-feed-1.peachnet.edu!athena.cs.uga.edu!phoenix.cs.uga.edu!shenShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,1a8cec9c98a6cfdb,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-12-30 11:14:57 PST
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!sol.ctr.columbia.edu!howland.reston.ans.net!gatech!news-feed-1.peachnet.edu!athena.cs.uga.edu!phoenix.cs.uga.edu!shen
From: shen@phoenix.cs.uga.edu (Mingzuo Shen)
Newsgroups: gnu.gcc.help
Subject: char char_tmp; if (char_tmp == 'i') {...} and setprecision(16) ???
Date: 30 Dec 1993 18:53:41 GMT
Organization: University of Georgia, Athens
Lines: 40
Distribution: na
Message-ID: <2fv83l$gd0@athena.cs.uga.edu>
NNTP-Posting-Host: phoenix.cs.uga.edu