You can use std::vector
:
#include <vector> typedef void (*FunPointer)(void *); std::vector<FunPointer> pointers;
If you really want to use a static array, it would be better to do this using FunPointer
i, defined in the snippet above:
FunPointer testArray[5]; testArray[0] = some_fun_pointer;
Although Iβll still go for a vector solution, given that you donβt know the size of the array at compile time and that you use C ++, not C.
source share