I would build an array, or an STL list, of function pointers and the strings that you find that trigger the call to them. If you really need to call an arbitrary function you should investigate RTTI http://en.wikipedia.org/wiki/Run-time_type_information