random enum c++ code example Example: c++ enum rand enum Color {Red, Green, Blue}; Color color = Color(rand()%3);