|
generally, the answer is "dont do that". there are very few instances where calling a function by string name is a good idea (dynamic linking and virtual functions being the exceptions). i'd love to hear your reason for doing this.
if you must do it, create an array of char *'s (the function name) and function pointers (the actual function you want called). then, just find the name that you were asked to invoke, and its associated pointer.
|