Can I delete a static pointer?

Discussion in 'C++' started by dolphin, Nov 30, 2007.

  1. dolphin

    dolphin Guest

    Can I delete a static pointer?
     
    dolphin, Nov 30, 2007
    #1
    1. Advertising

  2. "dolphin" <> wrote in message
    news:...
    > Can I delete a static pointer?


    You can call delete on a static pointer and release the memory it points to
    if it indeed points to memory that was allocated. If you are intending on
    calling delete on a static pointer that is shared amongst multiple objects
    I'd be careful...
     
    Christopher Pisz, Nov 30, 2007
    #2
    1. Advertising

  3. dolphin

    asterisc Guest

    On Nov 30, 7:44 am, dolphin <> wrote:
    > Can I delete a static pointer?


    Yes...

    Even if it's static, you need to manage the pointer - new/delete
    operations!
     
    asterisc, Nov 30, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. gorda
    Replies:
    5
    Views:
    5,095
    akhyls
    Mar 7, 2010
  2. Replies:
    10
    Views:
    740
    Chris Torek
    Feb 4, 2005
  3. jimjim
    Replies:
    16
    Views:
    873
    Jordan Abel
    Mar 28, 2006
  4. morz
    Replies:
    7
    Views:
    464
    Marco Wahl
    Feb 6, 2006
  5. Replies:
    4
    Views:
    1,323
    Fred Zwarts
    Jul 2, 2009
Loading...

Share This Page