A compressed array of managed locations that represents the Boolean value, True for open (1), and false to indicate that the bit is off (0).
Bitmap columns are used when you need to store bits, but do not know the number of bits beforehand.
Using system;using System.collections;namespace collectionsapplication{class Program {static void Main (Stri Ng[] (args) {//Create two lattice columns with a size of 8 BitArray Ba1 = new BitArray (8); BitArray Ba2 = new BitArray (8); Byte[] A = {60}; Byte[] B = {13}; Store the values 60 and 13 in the point array Ba1 = new BitArray (a); Ba2 = new BitArray (b); Ba1 content Console.WriteLine ("Bit array ba1:60"); for (int i = 0; i < Ba1. Count; i++) {Console.Write ("{0,-6}", Ba1[i]); } Console.WriteLine (); Ba2 content Console.WriteLine ("Bit array ba2:13"); for (int i = 0; i < Ba2. Count; i++) {Console.Write ("{0,-6}", Ba2[i]); } Console.WriteLine (); BitArray Ba3 = new BitArray (8); Ba3 = Ba1. and (BA2); Ba3 content Console.WriteLine ("Bit array ba3 after and Operation:12"); for (int i = 0; i < Ba3. Count; i++) {Console.Write ("{0,-6}", Ba3[i]); } Console.WriteLine (); Ba3 = Ba1. or (BA2); Ba3 content Console.WriteLine ("Bit array ba3 after OR operation:61"); for (int i = 0; i < Ba3. Count; i++) {Console.Write ("{0,-6}", Ba3[i]); } Console.WriteLine (); Console.readkey (); } }}
<a target=_blank href= "http://www.w3cschool.cc/csharp/csharp-bitarray.html" >http://www.w3cschool.cc/csharp /csharp-bitarray.html</a>
C # lattice column (BitArray)