Arrays of function pointers can be created like so:
typedef void(*FunctionPointer)();
FunctionPointer functionPointers[] = {/* Stuff here */};
What is the syntax for creating a function pointer array without using the typedef
?
Arrays of function pointers can be created like so:
typedef void(*FunctionPointer)();
FunctionPointer functionPointers[] = {/* Stuff here */};
What is the syntax for creating a function pointer array without using the typedef
?
Remember "delcaration mimics use". So to use said array you'd say
Correct? Therefore to declare it, you use the same:
Use this:
Works like everything else, you place [] after the name.
so your answer is
But naturally, this is a bad practice, just use
typedefs
:)Extra: Wonder how to declare an array of 3 pointers to functions taking int and returning a pointer to an array of 4 pointers to functions taking double and returning char? (how cool is that, huh? :))
:))