The Switch Statement in C++
The Switch Statement in C++
C++
The switch statement
simplifies complicated 'if then
else' constructs in C++.
If (x > 10)
{
DoFirstThing;
If – Then - Else
C also allows the use of any non
zero variable as the test in an if
statement. As long as the
variable is non-zero the test
evaluates true and the following
statement executes.