Re:How Do I Declare a Function Pointer in C?
by david-given on Thursday January 19, 2017 @02:31PM
(#13438743)
In C, the easiest thing to do is to just use a typedef. You get to use the same syntax as for normal function calls with no trying to remember where that blasted extra * goes, and typically end up with cleaner code anyway.
[ Parent
| on HN ]
Re:How Do I Declare a Function Pointer in C?
by bstamour on Thursday January 19, 2017 @02:43PM
(#13438849)
Yeah, typedefs solve the problem for fixed types. I guess you could use a macro to create a generic FUNC_PTR or something as well.