Having problems understanding enum in C++.
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
But what if I have two different enum types? Say
Code:
enum MyEnumType { ALPHA, BETA, GAMMA };
enum SomeonesEnumType { ALPHA, SATURDAY, MONDAY };
and these exist in a seperate class called "Enums".
if i were to type in my main.cpp,
which enum would it choose?
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