The
switch
statement is a short-hand form of an
if
-
else
chain, provided the test is performed on an expression returning an 'integral type' ( see
The C++ switch statement[
^] at
MSDN
).
That is the
if-else
chain is more general and powerful, while the
switch
statement is often handy.
:)