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;
}
Source by en.cppreference.com #
 
PREVIOUS NEXT
Tagged: #enum
ADD COMMENT
Topic
Name
6+5 =