Pointer problem

Discussion in 'C' started by techinspiration, May 21, 2010.

  1. techinspiration

    techinspiration New Member

    Joined:
    Feb 14, 2010
    Messages:
    54
    Likes Received:
    0
    Trophy Points:
    0
    Smart pointers does not works lots of time.
    What is the reason?
     
  2. techme

    techme New Member

    Joined:
    Feb 15, 2010
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    0
    There's a problem with this approach. There have three options for using
    smart pointers:

    Option 3 is out because it requires intimate knowledge of the
    different ways smart pointers can work and the uses it will be
    subjected to. The poster is asking what the point of pointers is
    (haha... *sees pun*) so I think it's safe to assume that neither of
    these points are met.

    Option 2 is better, but the lack of any standard implementation of
    smart pointers (besides auto_ptr) means that generic books can't teach
    it, libraries can't make good use of it, etc. Probably because of this
    (and in spite of auto_ptr) I didn't know what smart pointers were
    until a few days ago despite C++ programming for a couple years.

    Option 1 is the most promising until you realize that the auto_ptr
    doesn't behave appropriately in most circumstances. If the stardard
    library had a painter with reference counting, then things wauld be in
    much better shape.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice