I have predefined enum for buttons IDs:
typedef enum
{
button1ID = 407,
button2ID = 999,
button3ID = 408,
button4ID = 409,
} TOP_MENU_BUTTON_TYPE;
I need to find out if the ID I recieve is defiened in the enum. How can I do that? Something like:
if(id in TOP_MENU_BUTTON_TYPE)
If I understand your question clearly, then this would be helpful to you..
Instead of using
enumalone, you should try that withstructand here it is an answer by @Richard will help you how to do that.Change enum values at runtime?
https://stackoverflow.com/a/10305425/1083859
In the above link, he explains how to use a dynamic
enumvalues withstructand also you caniteratethe values to find out. I think you will get an idea.