Skip to main content
gamedev.net
🔒 Locked

Callback-functions

Started by test2 Jan 9, 2002 at 10:42 AM 2 replies 550+ views
Original Post
test2
test2
How to define, implement, pass and call callback-functions?
JonStelly
JonStelly
    

bool MyFunc(LPVOID pvParam);

typedef bool (*MYFUNC)(LPVOID);

bool CallFunc(MYFUNC pFunc, LPVOID pvParam)
{
return pFunc(pvParam);
}

int main(int argc, char* argv[])
{
CallFunc(MyFunc, NULL);
return 0;
}


That is a trivial and pointless example, but you just need to look into and understand function pointers to do whatever it is you're trying.

Edited by - jonstelly on January 9, 2002 12:02:49 PM

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.