谢谢了哦!!!!

解决方案 »

  1.   

    int[] aaa=new int[123];
    这恐怕不是你想要的答案吧?
    还请楼主把问题描述清楚,就这么一句话怎么知道你想要什么
      

  2.   

    很多获得数组的方法了。最简单的就是直接定义DataType[] ArrayName = new DataType[Count];
      

  3.   

    string Str="a,b,c,d,e";
    string[] Arr = Str.Split(',');
      

  4.   

    string Str="a,b,c,d,e,f";
    string[] Arr = Str.Split(',');
      

  5.   

    动态数组:
    System.Collections.ArrayList al = new System.Collections.ArrayList();
    al.Add(obj);
      

  6.   

    //初始化一维数据
    int[] a1 = new int[2];//默认值为0;
    int[] a2 = new int[]{1,2};
    //初始化等长二维数据
    int [,] ab1 = new int [2,3];//默认值为0;
    int [,] ab2 = new int [2,3]{{1,2,3},{4,5,6}};
    //初始化不等长二维数据
    int [][] abc = new int [2][];
    abc[0] = new int[]{1,2};
    abc[1] = new int[]{3,4,5,6};//一步步初始化更有助于理解;
    string[][] ColumnName = new string[3][];
    ColumnName[0] = new string[1] { "aaa"};
    ColumnName[1] = new string[] {"aaa","bbb" };
    ColumnName[2] = new string[3] {"aaa","bbb","ccc" };
      

  7.   

    在C#使用动态数组,不使用ArrayList
    public static Array Resize(Array array, int newSize)
    {
        Type type = array.Type;
        Array newArray = Array.CreateInstance(type.GetElementType(), newSize);
        Array.Copy(array, 0, newArray, 0, Math.Min(newArray.Length, newSize))l
        return newArray;
    }