2004-05-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
[mono.git] / mcs / tests / unsafe-3.cs
1 // this tests making a pointer to a pointer
2
3 using System;
4
5 unsafe class Foo
6 {
7         public static int Main ()
8         {
9                 int a;
10                 int *b;
11                 int **c;
12
13                 a = 42;
14                 b = &a;
15                 c = &b;
16                 
17                 Console.WriteLine ("*c == b : {0}", *c == b);
18                 Console.WriteLine ("**c == a : {0}", **c == a);
19
20                 if (*c == b && **c == a)
21                 {
22                         Console.WriteLine ("Test passed");
23                         return 0;
24                 }
25                 else
26                 {
27                         Console.WriteLine ("Test failed");
28                         return 1;
29                 }
30         }
31 }