Function Pointers

Discussion in 'C' started by buddy, Aug 31, 2007.

  1. buddy

    buddy New Member

    Joined:
    Aug 31, 2007
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    0
    Can any one tell me,in what kind of situation a function pointer can be used.

    Please give an example.

    Thanks
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Anywhere when you need to call different functions depending on some condition. Specially Some call back.

    Say When I call a function to fetch some data from a remote server.
    Now if its a synchronous call my caller can hang.
    So now the function which does the job takes some function pointer which is called when the job is done.
     

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