Skip to main content
gamedev.net
🔒 Locked

Pointer to function

Started by mdfmKoRn 0 replies 250+ views
Original Post
mdfmKoRn
mdfmKoRn
Is it possible to declare a pointer to a function?
      
void Render()
{
    // blah blah blah

}
VOID *p_Render();
p_Render()=&Render();
      
I tried this but the address-of operator returns an error saying l-value required. Is there something I'm missing? Can it be done at all? ---- Herb M. (mdfmKoRn) s3202@attbi.com Edited by - mdfmKoRn on December 24, 2001 10:37:24 AM Edited by - mdfmKoRn on December 24, 2001 10:37:55 AM
null_pointer
null_pointer
typedef void (*myfunctionpointertype)();

void render();

int main()
{
myfunctionpointertype p = &render
p();
return 0;
}

Topic Locked

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

Sign in to reply to this topic.