Say I have the following code:
int main()
{
enum colors { red = 0, green = 1, blue = 2 };
int myvar = instructions::red;
cout << myvar;
}
This will (of course) output '0'.
However, is it in any way possible to obtain the color name via user input and store the corresponding number in 'myvar'?