C++Tutorial for Beginners 24 - Switch: Choosing Between Alternatives

The switch statement is a more elegant alternative to lengthy if-elseif constructs. Switch used to be considered slow, but these days the opposite is said to be true; switch is an optimised, fast version of if-elseif. It also looks quite a bit nicer, depending on your taste ....