Tuesday, March 04, 2008

C++: Using string in switch

This is just a code snippet of how to use strings in switch in C++ which is taken for granted in C#
enum Config
{
SolidBall
};
std::map ‹string, Config› _mapStringConfig;
void Main()
{
switch(_mapStringConfig[str])
{
case MainProgram::SolidBall:
break;
}
}

No comments: