1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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,287
    Likes Received:
    364
    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