Article ID: 116447
Article Last Modified on 2/6/2004
(ostrstream(string,length)).operator<< ("\"quoted string\"")
-or-
ostrstream a(string,length);
a << "\"quoted string\""
/* Compile options needed: none
*/
#include <iostream.h>
#include <strstrea.h>
char s1[80];
char s2[80];
char s3[80];
void main()
{
ostrstream(s1,80) << "\"test 1\""; // bad output here
cout << s1 << endl;
(ostrstream(s2,80)).operator<< ("\"test 2\""); // OK
cout << s2 << endl;
ostrstream a(s3,80);
a << "\"test 3\""; // OK
cout << s3 << endl;
}
Additional query words: 1.00 1.50
Keywords: kbbug kbfix kblangcpp KB116447