>>try reducing the string to an integer using a map
IMO that would just complicate things even more, and I don't know if it would be very efficient either. I think it's just as simple to do:
That's not too hard to read is it?Code:#include <iostream> #define STR1 "String1" #define STR2 "String2" int main() { std::string test; std::cin>>test; if (test==STR1) //do something else if (test==STR2) //do something else }