I have 2 enums in 2 different modules that have exactly same value-set. How can I cast one to another?
typedef EnumA{
a_dog = 0,
a_cat = 1
} EnumA;
typedef EnumB{
b_dog = 0,
b_cat = 1
} EnumB;
EnumA a = a_dog;
EnumB b;
b = a;
Such an assignment is resulting in a warning: enumerated type mixed with another type Can I avoid switch-case by typecasting, like say
b = (int)a;
or
b = (EnumB)a;