Function Pointers

buddy's Avatar, Join Date: Aug 2007
Go4Expert Member
Can any one tell me,in what kind of situation a function pointer can be used.

Please give an example.

Thanks
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
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.