I don't really understand the behaviour of the ostringstream 's internal buffer considering this snippet :
ostringstream osTmp;
osTmp << 6 << "D";
const char *form1 = osTmp.str().c_str();
osTmp.str("");
osTmp.clear();
osTmp << 7 << "D";
const char *form2 = osTmp.str().c_str();
osTmp.str("");
osTmp.clear();
cout << form1 << endl;
cout << form2 << endl;
Here is the output :
6D
7D
Nevertheless, I would have expected that form1 and form2 are not anymore valid pointers....
Thanks a lot for your enlightenments.
Sylvain