Possible Duplicate:
How to check if enum value is valid?
I have a ENUM variable without intializing the values to each enum value. i.e.
enum TEST ={VALUE1,VALUE2,VALUE3};
Now, I create a variable (ENUM_TEST)
of type TEST
and values VALUE2
to it. How can I check that the ENUM_TEST
is having valid value or not?
When I tried printing ENUM_TEST
, I could see a special character instead of VALUE2
or 1
( as this is a default value for enum when we don't initialize).