#include "stdafx.h"
using namespace System;
using namespace System::Collections;
void Print( BitArray ^barray, String ^desc)
{
Console::WriteLine(desc);
int i = 0;
for each( bool^ val in barray )
{
Console::Write("{0} ", val);
if (++i > 7)
{
Console::WriteLine();
i = 0;
}
}
Console::WriteLine();
}
void main()
{
BitArray ^barray1 = gcnew BitArray( 8, true );
Print(barray1, "BitArray( 8, true );");
BitArray ^barray2 = gcnew BitArray( 8, true );
barray2->And(barray1);
Print(barray2, "And with BitArray( 8, true )");
barray2->SetAll(true);
barray2->Xor(barray1);
Print(barray2, "XOr with BitArray( 8, true )");
}