// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; namespace StarPtr { public class Program { public static void Main(string[] args) { int[] a = new int[4] { 1, 2, 3, 4 }; foreach(int ai in a) { Console.Write(" {0}", ai); } Console.WriteLine(); unsafe { fixed(int *p = &a[0]) { for(int i = 0; i < 4; i++) { int *p2 = p + i; Console.Write(" {0}", *p2); } Console.WriteLine(); } } } } }