Code:
Your code also jumps in 99,99% of tests into the "default" case and the last if-else statement.
Who me
Code:
If you hadn't use std::string the switch case would have got much better results. All cases should be used equally.
Lets not get personal
I know you're not talking about me. If I had wrote the code you best believe it be pack with in-line FASM some how. I just made it to charter-13 of Deitel C++. Now I can't wait to get out of school so I can explore C++. Just because the compile will do it all for me don't mean I don't want to peep under the s hood or do some things for myself. I don't have a true clue but interesting to figure that C++ can check SWITCH at bottom FIRST, but can't do the same for if ... if, if if, else, if, else etc. Kind of make since. It got to take it from the top to learn, but why loop EVERY statement, completely???
All though I saw no difference but the better programmers like you guy did, as a newbee this tells me to use switch when ever possible once I get started and let the standard continue to bicker about it. Optimization is optimization even if it save you an single clock and optimization turn on don't mean it's totally optimized. Humans can be smarter, even by accident. I can't wait to learn C++.