how to use enum class c++ code example
Example 1: enum c++
enum Colors
{
BLACK,
GREEN,
BLUE,
RED
};
Example 2: enum c++
enum Foo { a, b, c = 10, d, e = 1, f, g = f + c };
//a = 0, b = 1, c = 10, d = 11, e = 1, f = 2, g = 12
Example 3: enum c++
enum season
{ spring = 0,
summer = 4,
autumn = 8,
winter = 12
};