blob: 8366b3267c4558157c35b75aeb332531ade9999a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
// Compiler options: -unsafe
using System;
namespace ConsoleApplication6
{
unsafe class Program
{
static int a;
static int* the_ptr = (int*) 0xdeadbeaf;
static int** the_pptr = (int**) 0xdeadbeaf;
static void Main ()
{
Console.WriteLine ("TEST: {0:x}", new IntPtr (the_pptr).ToInt64 ());
fixed (int* a_ptr = &a) {
Console.WriteLine (new IntPtr (a_ptr));
int*[] array = { the_ptr };
int*[] array2 = { a_ptr };
int* ptr = the_ptr;
int** pptr = the_pptr;
fixed (int** pptr2 = &the_ptr) {
Console.WriteLine (new IntPtr (pptr));
}
}
}
}
}
|