Start here · Essential guide
Switch Case Statements in C++
A guide to switch case statements in C++: syntax, break and fall-through, the default label, what you can switch on and when if else works better.
Syntax and Functions
How switch case statements work and when they beat a chain of ifs.
Start here · Essential guide
A guide to switch case statements in C++: syntax, break and fall-through, the default label, what you can switch on and when if else works better.
Switch cases pick one block of code by matching an exact value, such as a menu choice or an enum. See a C++ menu example and when an if else chain is better.
Related topics