I've seen this link describing a fixed signature example but would like to know how to write a function that returns a pointer to a function whose signature depends on the argument to the calling function (if it is even possible)?
Example:
Suppose I have
typedef void (*func1) (int);
typedef void (*func2) (int, int);
I would like to have a function get_func
that returns a pointer to one or the other based on, say, the value of an integer argument, e.g.,:
get_func1(0)
returns func1
;
get_func2(1)
returns func2
.