RE: [Dev-C++] read numeric data in C++
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <Mat...@Ve...> - 2005-03-11 00:11:48
|
Well, even accounting for the weirdness, they still beat sprintf and
snprintf any day of the week!
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...]On Behalf Of Alfred P.
Reaud
Sent: Thursday, March 10, 2005 4:08 PM
To: Dev-Cpp UserList
Subject: RE: [Dev-C++] read numeric data in C++
Agreed, though that doesn't explain why the << operator doesn't append as
one would expect by the analogous functionality of cout. You don't normally
have to use a method call to set a string, you just use the = operator. It
could be by implication though, if you can take ss.str("") to be synonymous
with ss = "", if ss is a C++ string.
Further, that definitely doesn't explain why modifying the control state
flags, as the <http://www.cplusplus.com/ref/iostream/ios/clear.html> clear
method does, would cause the str("") method to occur. At least I'm not
seeing it specifically delineated out in the documentation, and couldn't
find it in the <sstream> file. It could be in another template, however,
that I haven't looked in.
I'm not saying you're wrong Matthew, what I mean is that it's kind of
inscrutable behavior on the part of string streams. Thanks for the lesson
folks, I'll make sure to refrain from the <sstream> class whenever possible.
;^)
Mat...@Ve... wrote:
For some reason this doesn't seem quite right, guys.
If you are trying to empty a stringstream object so you can fill it wil
new/different stuff just call ss.str("").
If you are trying to sync it up and write it out just call ss.flush().
HTH,
Matt
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...]On Behalf Of Alfred P.
Reaud
Sent: Thursday, March 10, 2005 3:30 PM
To: Dev-Cpp UserList
Subject: Re: [Dev-C++] read numeric data in C++
That's interesting. The symptom makes it look like istr or i is only being
set once. It's hard to tell without looking at it with a debugger....
<snip>
Alfred P. Reaud <mailto:al...@ya...>
<http://www.geocities.com/alreaud/>
___________________________________________________________________
The information contained in this message and any attachment may be
proprietary, confidential, and privileged or subject to the work
product doctrine and thus protected from disclosure. If the reader
of this message is not the intended recipient, or an employee or
agent responsible for delivering this message to the intended
recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify me
immediately by replying to this message and deleting it and all
copies and backups thereof. Thank you.
|