troubleshooting Question

Passing a combination of enum as a parameter

Avatar of bachra04
bachra04Flag for Canada asked on
6 Comments1 Solution339 ViewsLast Modified:
   enum EZZMASK
          eZZ_LOSS_ONLY            = 0x01,
          eZZ_DUPLICATE_ONLY       = 0x02,
          eZZ_RECEIPT_TIME_ONLY    = 0x04,
          eZZ_RECEIVER_REF_ONLY    = 0x08,
          eZZ_RECEIVER_DLRR_ONLY   = 0x10,
          eZZ_STAT_SUMMARY_ONLY    = 0x20,
          eZZ_VOIP_METRICS_ONLY    = 0x40

Void MyFunction (Param ???)


I want to call the function like this:

MyFunction (eZZ_LOSS_ONLY  | eZZ_DUPLICATE_ONLY   ) // or any other combination
So what parameter should I pass to MyFunction ?
Of course I can use an int. but I want to force the user of MyFunction to use the enum values and not to pass an int directly.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros