blob: 371b5bcdac2244b63ad988628245980793d89e8e (
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
|
// this tests making a pointer to a pointer
using System;
unsafe class Foo
{
public static int Main ()
{
int a;
int *b;
int **c;
a = 42;
b = &a;
c = &b;
Console.WriteLine ("*c == b : {0}", *c == b);
Console.WriteLine ("**c == a : {0}", **c == a);
if (*c == b && **c == a)
{
Console.WriteLine ("Test passed");
return 0;
}
else
{
Console.WriteLine ("Test failed");
return 1;
}
}
}
|