1 // Compiler options: -unsafe
5 class BoolArrayWithByteValues
8 static int Foo (ref bool b)
23 static unsafe bool Ptr ()
27 var arr = new byte [256];
28 for (int i = 0; i < arr.Length; i++)
30 fixed (byte* bptr = arr) {
32 for (int i = 0; i < arr.Length; i++) {
33 bool* boptr = (bool*)(bptr + i);
34 if (arr[i] > 0 && !*boptr)
36 System.Console.WriteLine ("#{0} = {1}", i, *boptr);
46 Buffer.SetByte (a, 0, 5);
70 var res = Foo (ref a [0]);