You can use the switch data type to store and manipulate Boolean values. The value of a switch can be used anywhere a test expression is permitted.
Switches are automatically initialized to
false when they are created. You should explicitly initialize switch variables before using them. Forgetting to initialize (or re-initialize) variables is a frequent source of errors.
You can initialize a switch when you declare it:
You can use the following operators with switch variables: