|
From: Chad S. <ho...@ho...> - 2000-12-07 16:57:52
|
Sorry, I need to clarify.. It's the
MyString = MyStream.str();
line that the compiler bombs on.
This other line with the parentheses is ok.
((MyString += "John has ") += "4") += " apples!";
Chad Simmons
>From: "Chad Simmons" <ho...@ho...>
>Reply-To: dev...@li...
>To: dev...@li...
>Subject: RE: [Dev-C++] string-version of '+'
>Date: Thu, 07 Dec 2000 08:44:28 -0800
>
>Interesting.. I decided to actually test the code I was promoting, and I
>found a problem with the compiler.. It seems to bomb out on this bit of
>code..
>
>#include <string>
>#include <iostream>
>#include <strstream>
>using namespace std;
>
>int main(int argc, char *argv[])
>{
> string MyString;
> strstream MyStream;
>
> ((MyString += "John has ") += "4") += " apples!";
>
> cout << MyString << endl;
>
> MyStream << "John has " << 10 << " apples!";
>
> MyString = MyStream.str();
>
> cout << MyString << endl;
>
> return 0;
>}
_____________________________________________________________________________________
Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com
|