Search Result

Collapse
2 results in 0.0027 seconds.
Keywords
Members
Tags
ostringstream erase
  •  

  • Àî°×
    Guest started a topic how to clear a stringstream object's data, not state.
    in C

    how to clear a stringstream object's data, not state.

    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",...
    See more | Go to post

  • Christopher Benson-Manica
    Guest started a topic Clear a stringstream
    in C

    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() ;
    ...
    See more | Go to post
Working...