int[,]是定义矩阵的数组,初始化int[,] intArray = new int[3, 8];
读取、获取方式,只能采用intArray[i,j]。

 
int[][].定义可变成的数组,但是初始化必须知道数组行数 int[][] intsdf =new int[3][];
然后再对具体的行初始化个数
intsdf[0] = new int[8];
intsdf[1] = new int[9];
intsdf[2] = new int[10];
读取、获取方式,只能采用intArray[i][j]。

 
以下两种定义会报错
int[][] intsdf =new int[3][5];
int[][] intsdf =new int[][];

posted on 2009-07-24 16:08    阅读(495)  评论(0编辑  收藏  举报