in my c++-book is an example how to use pointer to functions:
this would call compare. (I don't have the book here, so i am not 100% sure if the * belongs in front or at the end of funcptr.Code:compare(double, double); (funcptr*)(double, double); funcptr = compare; (funcptr*)(double, double);
My problem is now in my case:
Of course i can't just write it the same like above, since one is a pointer and one is a string object.Code:string funcname = "compare"; funcptr = funcname;
Anyone could help me, how i could make it work?
PS: Why I need this? i'd like to write less code due to the large if/case i would need to write for any possible option.