hi all:
I want erase a stringstream' content for input new data to it.
example:
std::stringstre am stm;
stm<<"this is a string";
std::cout<<stm. str();
// here print:this is a string
// do something here of the stm, i don't know .....
stm<<"not a string";
std::cout<<strm .str();
// I want print "not a string",...
Search Result
Collapse
2 results in 0.0027 seconds.
Keywords
Members
Tags
-
how to clear a stringstream object's data, not state.
-
Clear a stringstream
This is a subtle variation of a question I posted some time ago.
#include <map>
#include <iostream>
#include <sstream>
int main(void)
{
try {
std::stringstre am s;
std::cout << "s=" << s.str() << "\n";
s << "Hello, world!\n";
std::cout << "s=" << s.str();
s.str().erase() ;
...