Neither C nor C ++ has enough reflection to make it out of the box, so you have to implement your own scheme.
In C ++, a more or less canonical way to do this is to use a string map to indicate pointers. Something like that:
typedef void (*func_t)(); typedef std::map<std::string,func_t> func_map_t;
Of course, this is limited to functions with exactly the same signature. However, this restriction can be somewhat removed (to cover reasonably compatible signatures) using std::function and std::bind instead of a simple function pointer.
source share