// 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; class MainClass { public unsafe static void Test(int *a) { for(int col = 0; col < 3;col++) { Console.Write(" " + a[col]); } Console.WriteLine(); } public static void Main(string[] args) { int[,] a = new int[2,3]; for(int row = 0; row < 2; row++) { for(int col = 0; col < 3;col++) { a[row,col] = (row + 1) * (col + 1); } } for(int row = 0; row < 2; row++) { for(int col = 0; col < 3;col++) { Console.Write(" " + a[row,col]); } Console.WriteLine(); } unsafe { fixed(int *p = &a[0,0]) Test(p); } } }