Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ enum

enum Color { red, green, blue };
Color r = red;
switch(r)
{
    case red  : std::cout << "red
";   break;
    case green: std::cout << "green
"; break;
    case blue : std::cout << "blue
";  break;
}
 
PREVIOUS NEXT
Tagged: #enum
ADD COMMENT
Topic
Name
7+9 =