Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 643967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:20:25+00:00 2026-05-13T21:20:25+00:00

With enum under .net the biggest number you can use is ULong. This mean

  • 0

With enum under .net the biggest number you can use is ULong.
This mean a maximum of 64 flags.

What would be the alternative when you need more than 64 flags?

Edit

Sorry, I forgot to add this, alternative that would still work with bitwise operations at least these one; and and or.

using Josh Einstein suggestion, I came up with this, does it make sense?

class bitArrayFlag
{
    private const int flagSize = 255; //allow X numbers of flags

    public BitArray flag1;
    public BitArray flag2;
    public BitArray flagN;

    public bitArrayFlag()
    {
        int flagPos = 0;
        bool[] flagBit = new bool[flagSize];

        flagBit[flagPos] = true;
        flag1 = new BitArray(flagBit);

        flagBit[flagPos] = false;
        flagPos += 1;
        flagBit[flagPos] = true;
        flag2 = new BitArray(flagBit);

        //...
        //...
        //...

        flagBit[flagPos] = false;
        flagPos += 1;
        flagBit[flagPos] = true;
        flagN = new BitArray(flagBit);
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T21:20:25+00:00Added an answer on May 13, 2026 at 9:20 pm

    You could then switch to using a BitArray. You would lose all the “features” of an enum such as the default string formatting and parsing ability. A BitArray would be fundamentally similar to having a bunch of boolean fields except that the storage is much more efficient.

    Indeed as Jeff says in the comments with that many independent bit states it seems like an Enum is the wrong solution anyway. A BitArray may be much more suitable for your particular scenario.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an enum enum myEnum2 { ab, st, top, under, below} I would
I want to use an Enum to represent some selection values. In the /src/groovy
I have an enumeration of just under 32 absolute rectangle sizes and I need
Consider the following class: class Foo { enum Flags {Bar, Baz, Bax}; template<Flags, class
Is it possible under any set of circumstances to be able to accomplish this?
Under what circumstances is an enum more appropriate than, for example, a Collection that
I need to figure out how to get an element on an enum in
I've read a number of posts about this error, but none of the solutions
In VS2010 for a VB.NET 4.0 project, the IDE puts a green line under
This question relates to casting of enums within generic methods Given an enum public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.