M
Maitre Bart
The following simple program overwrites the content of an ostriungstream
object.
#include <iostream>
#include <sstream>
using namespace std;
int main()
{
ostringstream oss;
oss << "0123456789" << ends;
cout << '[' << oss.str() << ']' << endl;
oss.seekp(0);
oss << "toto" << ends;
cout << '[' << oss.str() << ']' << endl;
return 0;
}
In MS-DEV-6, the output was (as I suspected):
[0123456789]
[toto]
In MS-DEV-7.1, the output is (note the extra space):
[0123456789 ]
[toto 56789 ]
May someone tell me what is wrong?
object.
#include <iostream>
#include <sstream>
using namespace std;
int main()
{
ostringstream oss;
oss << "0123456789" << ends;
cout << '[' << oss.str() << ']' << endl;
oss.seekp(0);
oss << "toto" << ends;
cout << '[' << oss.str() << ']' << endl;
return 0;
}
In MS-DEV-6, the output was (as I suspected):
[0123456789]
[toto]
In MS-DEV-7.1, the output is (note the extra space):
[0123456789 ]
[toto 56789 ]
May someone tell me what is wrong?