error: switch quantity not an integer

In switch, the expression must be of “an integral type or of a class type for which there is an unambiguous conversion to integral type” (quoting VS2008 docs). A string class doesn’t have “unambiguous conversion to integral type”, like a char does. As a work-around: Create a map<string, int> and switch on the value of the map: switch(command_map[command]) ` Do a set of if/else instead of … Read more