|
-
March 16th, 2004, 07:38 AM
#1
Array of enum elements!
Hi all, I hope some of you can help me.
I have defined an enum with different possible events
typedef enum _TEvent
{
event1 = (1uL<<1),
event2 = (1uL<<2),
event3 = (1uL<<4)
} TEvent;
And now I want to define an Array in which each element is a mask of the elements of the enumeration, for example:
TMask[0] = event1 | event3;
Tmask[1] = event2 | event3;
Tmask[2] = event1;
Etc…
Now I will receive an event and I have to see if it is part of the mask
For (int i=0; i<Tmasksize; i++)
{
if (event & Tmask[i])
{
}
}
How can I define this array? Thanks in advance for you answers, I really appreciate it!
Jose.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|