Set the four elements of the BitArray and display the elements of the BitArray : BitArray : Data Structure C# Examples


C# Examples » Data Structure » BitArray »

 

Set the four elements of the BitArray and display the elements of the BitArray









    
using  System;
using  System.Collections;

class  MainClass
{
    public  static  void  Main()
    {
        BitArray  myBitArray  =  new  BitArray(4);

        Console.WriteLine("myBitArray.Length  =  "  +  myBitArray.Length);
        myBitArray[0]  =  false;
        myBitArray[1]  =  true;
        myBitArray[2]  =  true;
        myBitArray[3]  =  false;

        
        for  (int  i  =  0;  i  <  myBitArray.Count;  i++)
        {
            Console.WriteLine("myBitArray["  +  i  +  "]  =  "  +  myBitArray[i]);
        }
    }
}
    
   
  
   



Output

myBitArray.Length = 4
myBitArray[0] = False
myBitArray[1] = True
myBitArray[2] = True
myBitArray[3] = False


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Structure
» BitArray