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

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

using System;

struct SS
{
}

public class C
{
	public static int[] field = new int [] { 66 };

	public static int Main()
	{
		unsafe {
			SS* ss = stackalloc SS [10];
			SS* s1 = &ss [5];
	    
			int* values = stackalloc int[20];
			int* p = &values[1];
			int* q = &values[15];

			Console.WriteLine("p - q = {0}", p - q);
			Console.WriteLine("q - p = {0}", q - p);
		}
		return 0;
	}
}