How to call function through its address in C

Your typedef is wrong. Better would be

typedef void* (*originalAddress)(int, int);

Your cast is wrong, too. void* is a data pointer, not a function pointer. Use a cast to void* (*)(int, int), or even better to originalAddress.

Leave a Comment