I’m having really hard time comprehending the syntax for function pointers. What I am trying to do is, have an array of function pointers, that takes no arguments, and returns a void pointer. Can anyone help with that?
I’m having really hard time comprehending the syntax for function pointers. What I am
Share
First off, you should learn about
cdecl:You can do it by hand – just build it up from the inside:
ais an array:
a[10]of pointers:
*a[10]to functions:
(*a[10])taking no arguments:
(*a[10])(void)returning
void *:void *(*a[10])(void)It’s much better if you use
typedefto make your life easier:And then make your array: