int kpSize = 4;
int kpIdx = 0;
typedef int (*EventHandler) (void *);
EventHandler *keyFuncArray = (EventHandler *) malloc(sizeof(EventHandler) * kpSize);
I get the following error on compiling, error C2099: initializer is not a constant on the following line
EventHandler *keyFuncArray = (EventHandler *) malloc(sizeof(EventHandler) * kpSize);
typedef. If you didtypedef int EventHandler (void*);then you could increase type safety drastically and get rid of the obscure pointer-to-function-pointer:EventHandler* keyFuncArray = malloc(sizeof(EventHandler*[kpSize]));. I can't come up with a case where a pointer to a function pointer would make sense.