ostringstream(const string &str, int=ios::out) {
sstr = new ostrstream((char *)str.c_str(), str.size(), ios::out);
}
- ~ostringstream() { delete sstr; }
- std::string str() { return std::string(sstr->str()); }
+ ~ostringstream() { delete sstr->str(); delete sstr; }
+ std::string str() {
+ std::string _str = std::string(sstr->str()); _str.append('\0');
+ return _str;
+ }
int pcount() { return sstr->pcount(); }
};