How can I create a function pointer to a function where some parameters are set to be fixed upon the definition.
Here is an example what I mean:
Let's say I have the function
int add (int n, int m) {
return n+m;
}
and the function pointer type
typedef int (*increaser)(int);
What I want is a pointer to the function add which fixes the first parameter to 1 and leaves the second paramenter open. Something along the lines of
increaser f = &add(1,x);
How can I accomplish this?
increaser. To me, it is rather anint_unary_operator, as functions implementing this signature can very well do something completely different.