Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test-403.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c757fd54c1eeb36ea266c799939094fa75ba3d03 (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
32
33
// Compiler options: -unsafe

// 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;
		}
	}
}