1. 程式人生 > >.net 基礎知識大雜燴(4) ——陣列

.net 基礎知識大雜燴(4) ——陣列

int[,] t = new int[2,3] { { 1, 2, 3 },
                                      { 4, 5, 6 } };
            int[,] t1 = new int[,] { { 1, 2, 3 },
                                     { 4, 5, 6 } };
            Console.WriteLine(t.Length); //=> 6
            Console.WriteLine(t.Rank);   //=> 2
            Console.WriteLine(t.GetLength(0)); // => 2
            Console.WriteLine(t.GetLowerBound(0)); // => 0
            Console.WriteLine(t.GetUpperBound(0)); // => 1
            Console.WriteLine(t.GetLowerBound(1)); // => 0
            Console.WriteLine(t.GetUpperBound(1)); // => 2
            Console.WriteLine(t.GetLength(1)); // => 3