I already know how to create functions that return pointers to functions that have already been defined at compile time, like in this example:
1 2 3 4 5 6 7 8 9 10
typedeffloat(*pt2Func)(float, float);
float Plus (float a, float b) { return a+b; }
float Minus (float a, float b) { return a-b; }
pt2Func GetPtr2(constchar opCode)
{
if (opCode == ’+’) return &Plus;
elsereturn &Minus;
}
Which myfunc do you mean? The same as above? Because it doesn't take two floats as its parameters.
If you mean some other function, functors are probably what you're looking for.
Which myfunc do you mean? The same as above? Because it doesn't take two floats as its parameters.
If you mean some other function, functors are probably what you're looking for.