// 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 E { public class Program { public static void Main(string[] args) { int[,] a = new int[3,3]; for(int i = 0; i < 3; i++) { for(int j = 0; j < 3; j++) { a[i,j] = 3*i+j+1; } } int[] a1 = new int[3]; Buffer.BlockCopy(a, 3*sizeof(int), a1, 0, 3*sizeof(int)); Console.WriteLine(a1[0] + " " + a1[1] + " " + a1[2]); int[][] b = new int[3][]; for(int i = 0; i < 3; i++) { b[i] = new int[3]; for(int j = 0; j < 3; j++) { b[i][j] = 3*i+j+1; } } int[] b1 = b[1]; Console.WriteLine(b1[0] + " " + b1[1] + " " + b1[2]); } } }