In Java it's just as follows. I don't know if there is a .length method/function in C# though!
Then you could just tranverse the array with a nested loop to either look up a value or fill the array.Code:int[][] arrayName = new int[2][2];
Code:(for int i=0; i < arrayName.length; i++) { for(int j = 0; j < arrayName[i].length; j++) { //do whatever } // do whatever }




Reply With Quote