我想定义一个大小为1000的数组,数组里的每个元素是大小为20的数组,这样的数组该怎么定义?
int[][] a = new int [1000][];
for(int i =0;i<1000;i++)
a[i]= new int[20];
int*[] a = new int *[1000];
for(int i =0;i<1000;i++)
a[i]= new int[20];
用2维数组:
string[,] list = new string[1000, 20];
或用List:
List<List<string>> list = new List<List<string>>();
都可以