Constructs and initializes a new instance of the BitArray class with the specified Count and where the inital values are all set to false.
- length
- The Length (Count) of the new BItArray.
The initial value of all Bits is false.
C# Example
using System; using System.Collections; public class BitArrayFromInt { public static void Main () { BitArray bitArray = new BitArray (7); Console.WriteLine ("bitArray.Count: {0}", bitArray.Count); for (int i = 0; i < bitArray.Count; i++) Console.WriteLine ("bitArray [{0}]: {1}", i, bitArray [i]); } }Compiling and running the above example generates the following output:
bitArray.Count: 7
bitArray [0]: False
bitArray [1]: False
bitArray [2]: False
bitArray [3]: False
bitArray [4]: False
bitArray [5]: False
bitArray [6]: False
Namespace: System.Collections
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0