I am making a command prompt in C++. I would like a user to enter a line such as “say something”. This will then be split up so that “say” would be the command name and “something” would be a parameter. So far, so good – this is already working.
I would then like to use the name of the command to call the appropriate method. I could use some kind of look-up table but is there a better method?
probably you need something like map of command keywords and function or method pointers