Calling functions through pointers
I can''t seem to find out if there''s a way to do this...
If I have a whole bunch of functions that all follow this prototype:
void FunctionName(void);
and I keep a pointer to one of these functions, can I use that pointer to call the function...?
-Arek the Absolute
-Arek the Absolute"The full quartet is pirates, ninjas, zombies, and robots. Create a game which involves all four, and you risk being blinded by the sheer level of coolness involved." - Superpig
typedef void (*fnptr)(void);
fnptr fn1 = &FunctionName
or
fnptr fn1 = FunctionName;
(*fn1)();
or
fn1();
fnptr fn1 = &FunctionName
or
fnptr fn1 = FunctionName;
(*fn1)();
or
fn1();
---visit #directxdev on afternet <- not just for directx, despite the name
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement