1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

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,276
    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