Calling a function named in a variable.
I looked. I really did. Anyway...
Is it possible in c++ to call a function the name of which is contained in a variable?
Psuedo code (which is a euphemism for I can't write code that works):
Code:
double MYROUTINE(double x){
// do stuff
}
double MYBOSSESROUTINE(const char* z)
{
// value of z is "MYROUTINE"
call z // <== obviously that doesn't work
}
Thanks
John
Maybe I'm not understanding
I can't change the signature of MYBOSSESROUTINE from:
double MYBOSSESROUTINE(const char* z)
to
double MYBOSSESROUTINE(SOME_FN z)
All I'm allowed to do is pass him a string with the name of my function.