Check out example codes for "c++ enum rand". It will help you in understanding the concepts better.

Code Example 1

enum Color {Red, Green, Blue};
Color color = Color(rand()%3);

Learn ReactJs, React Native from akashmittal.com