I have observed some awesome usage of function pointers in android C/C++. My sample application similar to that code:
#include <conio.h>
void fn( void (*seekDoneCb)() )
{
void (*mSeekDoneCb)() = seekDoneCb;
(*mSeekDoneCb)();
}
void Seek()
{
printf("Seek()fn Called");
}
int main(int argc, _TCHAR* argv[])
{
fn(Seek);
getch();
return 0;
}
Output:Seek()fn Called
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment