Re: ? How to clear ostringstream buffer

Discussion in 'C++' started by Mark Warren, Jul 23, 2003.

  1. Mark Warren

    Mark Warren Guest

    Use myO.str(""). A non-obvious use and IMHO poor design, a function should
    only have one use.

    Mark Warren, Jul 23, 2003
    1. Advertisements

  2. Mark Warren

    Ericcson Guest

    Many thanks, Mark. It works OK.


    Ericcson, Jul 23, 2003
    1. Advertisements

  3. Mark Warren

    tom_usenet Guest

    That function does only have one use (to set the string held by the
    ss). Or are you against overloading?

    tom_usenet, Jul 23, 2003
  4. Mark Warren

    Sam Holden Guest

    It also returns the current string (an example of such usage was in the

    Hence one function, two uses.

    Overloading a function name is fine, but the functions should do the
    similar actions.
    Sam Holden, Jul 23, 2003
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.