在C#中如何弄出一个动态二维数组?

就是说我搞出这个二维数组,想要几行几列都可以,这是叫动态数组吗?应该怎么定义和调用其中元素呢(是不是用arrylist?),谢谢!

我们一般说冲含迟的动态,是指老旅在运行过程中随时可以添加修改行列的,如果你已经确定知道要几行几列那就不是动态了,动态数组一般是用List实现的,比如

List<List<int>> array = new List<List<int>>();
List<int> item = new List<int>(new int[] { 3, 4, 5, 6 });
array.Add(item);
item = new List<int>(new int[] { 30, 40, 50, 60 散李});
array.Add(item);
int m = array[1][2];//此时的m即为50

public static void Main(string[] args)
        {
            int row = 2, column = 3;
            int[,] a = new int[row, 桐旁column];
            Console.WriteLine(a.Length);
            row = 5; 
   握雀         column = 4;
            a = new int[row, column];
            Console.WriteLine(a.Length);
            
            Console.WriteLine("二维数组的使用:");
            for (int i = 0; i < row; i++)
            {
                for (int j = 0; j < column; j++)
                {
                    Console.Write(a[i, j]+ " ");
             局皮橡   }
                Console.WriteLine();
            }
            Console.ReadLine();
        }

用泛型的list<>,挺好用的,习惯下比二维数组好用,支持派春历查找、调用等等操作,尘搜方法比数组森粗多。而且c#2008以上支持更好。