Original Post
After spending sometime trying to figure out pointers to functions I finally found out how they work. They are relatively simple. Suppose you had a function called DoSomething:
You would then make a pointer to a function like this:
And to call it:
That''s all.
SloppyJoe
BOOL DoSomething(int nParameter)
{
MessageBox(NULL, "This is a MessageBox", "Title", MB_OK);
return(TRUE);
}
|
//return_type (*var_name)(param_type) BOOL (*lpfnDoSomething)(int); (*lpfnDoSomething) = DoSomething; |
(*lpfnDoSomething)(10); |