Having problems understanding enum in C++.
But what if I have two different enum types? SayQuote:
There is an implicit conversion from any enum type to int. Suppose this type exists:
enum MyEnumType { ALPHA, BETA, GAMMA };
Then the following lines are legal:
int i = BETA; // give i a value of 1
int j = 3 + GAMMA; // give j a value of 5
and these exist in a seperate class called "Enums".Code:enum MyEnumType { ALPHA, BETA, GAMMA };
enum SomeonesEnumType { ALPHA, SATURDAY, MONDAY };
if i were to type in my main.cpp,
which enum would it choose?Code:Enums::ALPHA;
I can't seem to find a way to specify which enum I would like to use (e.g. like in Java, I can just type Enums.MyEnumType.ALPHA and Enums.SomeonesEnumType.ALPHA