I've searched but couldn't find any results (my terminology may be off) so forgive me if this has been asked before.
I was wondering if there is an easy way to call a
ptr = <some address>;
((void*())ptr)(); /* call ptr as function here */
Your cast should be:
((void (*)(void)) ptr)();
In general, this can be made simpler by creating a
typedef for the function pointer type:
typedef void (*func_type)(void); ((func_type) ptr)();
I should, however, point out that casting an ordinary pointer (pointer to object) to or from a function pointer is not strictly legal (although it is a common extension).