type case in c++ code example
Example 1: casting C++
int main()
{
short a = 2000;
int b;
b = (int)a; // c-like cast notation
b = int(a); // functional notation
}
Example 2: case in c++
switch (n)
{
case 1: // code to be executed if n = 1;
break;
case 2: // code to be executed if n = 2;
break;
default: // code to be executed if n doesn't match any cases
}