Constructs and initializes a new instance of the BitArray class where the inital values are set by the bool array.
- values
- A bool array.
The size of the new BItArray will be the same as the Length of the Boolean array.
C# Example
using System; using System.Collections; public class BitArrayFromBoolArray { public static void Main () { BitArray bitArray = new BitArray (new bool [] {true, true, false, false, true}); 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: 5
bitArray [0]: True
bitArray [1]: True
bitArray [2]: False
bitArray [3]: False
bitArray [4]: True
Namespace: System.Collections
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0