This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bug or not


Hi Anthony,

The problem isn't that you are using a ostringstream's string-parm constructor.

The problem is that you are printing out the string used to INITIALIZE the ostringstream.  What you should be doing is printing out the CURRENT contents of the ostringstream buffer.

Use the...
cout << outBuffer.str() << endl;
...method of accessing the ostringstream's string in the first situation.

HTH,
--Eljay



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]