Pointers

Discussion in 'C' started by boschow, Jul 2, 2007.

  1. boschow

    boschow New Member

    Joined:
    Feb 22, 2007
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    0
    Hi,
    i just wanted to know, what are pointers used for?
    when do we use pointer to a symbol?
    when do we use pointer to a function?
    when do we use pointer to a pointer . .. ?

    Thanks for your time and help,
    Best regards
    BoSCHoW
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Mainly pointers are used for passing the address of the variables so the update in a function remains when the function is out of scope.
    I assume you meant here variable and when we need the address of the variable.
    I normally avoid using this but when we don't know which exact function to be called but know the type of the function. Is used for event handling where we don't know what is the event handler that will be assigned to the pointer but if its assigned it will have some standard signature.
    As and when needed and in interviews.
     

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