Article View: uchi.cs.cs355
Article #1floats break istrstream
From: Tom McDougal
Date: Tue, 07 May 1991 16:21
Date: Tue, 07 May 1991 16:21
13 lines
1074 bytes
1074 bytes
I was trying to read a float off the command line using the nifty
new istrstream function:
float x;
istrstream(argv[1]) >> x;
but no matter what I put on the command line, x=0.
Changing x to a double fixed the problem.
-Tom (mcdougal@cs.uchicago.edu)
--Tom (mcdougal@cs.uchicago.edu)
Technical Details
Message-ID:
<1991May7.162120.20570@midway.uchicago.edu>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp!utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!caen!uwm.edu!linac!midway!tartarus.uchicago.edu!mcdougalShow Full Headers
Complete Article Headers
Message-ID: <1991May7.162120.20570@midway.uchicago.edu> Subject: floats break istrstream Date: Tue, 07 May 1991 16:21:20 +0000 From: mcdougal@tartarus.uchicago.edu (Tom McDougal) Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp!utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!caen!uwm.edu!linac!midway!tartarus.uchicago.edu!mcdougal Newsgroups: uchi.cs.cs355,comp.lang.c++ Keywords: strstream,floats Sender: news@midway.uchicago.edu (NewsMistress) Reply-To: mcdougal@tartarus.uchicago.edu (Tom McDougal) Distribution: usa Organization: U. Chicago Computer Science Dept. Lines: 12