Function Pointers

Go4Expert Member
31Aug2007,19:15   #1
buddy's Avatar
Can any one tell me,in what kind of situation a function pointer can be used.

Please give an example.

Thanks
Go4Expert Founder
31Aug2007,22:20   #2
shabbir's Avatar
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.