Just use a if() { } else if () { }
chain. Using a hash value is going to be a maintenance nightmare. switch
is intended to be a low-level statement which would not be appropriate for string comparisons.
More Related Contents:
- sizeof works unusual at c++ after array creation [duplicate]
- Unterminating c++ Program [closed]
- Where did I go wrong in my code for word count C++
- How can I read and parse CSV files in C++?
- Accessing an array out of bounds gives no error, why?
- What are some uses of template template parameters?
- Size of character (‘a’) in C/C++
- Pure virtual function with implementation
- Can I set a breakpoint on ‘memory access’ in GDB?
- Combining C++ and C – how does #ifdef __cplusplus work?
- Best C++ Code Formatter/Beautifier
- How do I forward declare an inner class? [duplicate]
- What is the idea behind ^= 32, that converts lowercase letters to upper and vice versa?
- Visual Studio 2015 “non-standard syntax; use ‘&’ to create a pointer to member”
- C++ Compiler Error C2280 “attempting to reference a deleted function” in Visual Studio 2013 and 2015
- Try to understand compiler error message: default member initializer required before the end of its enclosing class
- structured bindings: when something looks like a reference and behaves similarly to a reference, but it’s not a reference
- Error: cannot bind non-const lvalue reference of type ‘int&’ to an rvalue of type ‘int’
- The Pimpl Idiom in practice
- C++11 full support on Eclipse [closed]
- Passing Variable Number of Arguments with different type – C++
- “No appropriate default constructor available”–Why is the default constructor even called?
- How to break out of a loop from inside a switch?
- c++ sort with structs
- Why isn’t there int128_t?
- How to iterate std::set?
- Scope and return values in C++
- Duplicate const qualifier allowed in C but not in C++?
- Sorry, unimplemented: 64 bit mode not compiled in
- Find available network interfaces in C/C++? [closed]