I want to use an enum type and print out the constant rather than the integer value. Here is my enum type
enum Color { black=0, red, orange, yellow, green,
blue, indigo, violet, white};
Color color;
color = red;
cout << color; This would give me the value 1.
How do I get "red" printed to the screen instead of the 1?
enum Color { black=0, red, orange, yellow, green,
blue, indigo, violet, white};
Color color;
color = red;
cout << color; This would give me the value 1.
How do I get "red" printed to the screen instead of the 1?