deleteing an ostringstream

This is a discussion on deleteing an ostringstream within the C++ Programming forums, part of the General Programming Boards category; I have a ostringstream and I ues it, but than when I am done using should I delete it? if ...

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    731

    deleteing an ostringstream

    I have a ostringstream and I ues it, but than when I am done using should I delete it? if so how?

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    7,319
    If you are done using it, let it go out of scope like any other variable and it will be cleaned up automatically. There is no need to delete it any more than you need to delete a variable of any other type.

    If you use new to create it, you would of course have to delete it, but you probably don't need to create an ostringstream with new.

  3. #3
    Registered User
    Join Date
    Aug 2004
    Posts
    731
    Ok I'v been wondering that becuase I use it in a function and the function is called over and over and stuff, but ok sounds good.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Create a ostringstream like class.
    By ThLstN in forum C++ Programming
    Replies: 6
    Last Post: 09-06-2008, 08:43 PM
  2. How to clear ostringstream?
    By maxorator in forum C++ Programming
    Replies: 5
    Last Post: 10-14-2005, 04:44 PM
  3. Deleteing mutipule files
    By Queatrix in forum C++ Programming
    Replies: 14
    Last Post: 04-17-2005, 12:08 PM
  4. ostringstream question
    By Swaine777 in forum C++ Programming
    Replies: 1
    Last Post: 07-10-2003, 06:43 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21