illustrates the use of a BitArray : BitArray « Collections Data Structure « C# / C Sharp

Home
C# / C Sharp
1.2D Graphics
2.Class Interface
3.Collections Data Structure
4.Components
5.Data Types
6.Database ADO.net
7.Date Time
8.Design Patterns
9.Development Class
10.Event
11.File Stream
12.Generics
13.GUI Windows Form
14.Internationalization I18N
15.Language Basics
16.LINQ
17.Network
18.Office
19.Reflection
20.Regular Expressions
21.Security
22.Services Event
23.Thread
24.Web Services
25.Windows
26.Windows Presentation Foundation
27.XML
28.XML LINQ
C# Book
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source
C# / C Sharp » Collections Data Structure » BitArrayScreenshots 
illustrates the use of a BitArray
illustrates the use of a BitArray
 
/*
  illustrates the use of a BitArray
*/

using System;
using System.Collections;

public class Example11_4
{

  public static void Main()
  {

    // create a BitArray object
    BitArray myBitArray = new BitArray(4);

    // display the Length property
    Console.WriteLine("myBitArray.Length = " +
      myBitArray.Length);

    // set the four elements of the BitArray
    myBitArray[0false;
    myBitArray[1true;
    myBitArray[2true;
    myBitArray[3false;

    // display the elements of the BitArray
    for (int counter = 0; counter < myBitArray.Count; counter++)
    {
      Console.WriteLine("myBitArray[" + counter + "] = " +
        myBitArray[counter]);
    }

  }

}


           
         
  
Related examples in the same category
1.Demonstrate BitArrayDemonstrate BitArray
2.Use BitArray collection as Flag
3.illustrates the use of BitArray methodsillustrates the use of BitArray methods
4.BitArray Class manages a compact array of bit values
5.Displays the properties and values of the BitArrays
6.BitArray.CopyTo copies the entire BitArray to a compatible one-dimensional Array
7.Gets the value of the bit at a specific position in the BitArray.
8.Inverts all the bit values in the current BitArray
9.Performs the bitwise OR operation
10.Performing OR between BitArray instances of different sizes returns an exception
11.Performs bitwise exclusive OR operation
java2s.com  |  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.