1int a[2][3]= {
2 {1, 2, 3},
3 {4, 5, 6}
4 };
5
6 cout << a[1][1]; // Output is 5
1// Either
2int disp[2][4] = {
3 {10, 11, 12, 13},
4 {14, 15, 16, 17}
5};
6
7// Or
8int disp[2][4] = { 10, 11, 12, 13, 14, 15, 16, 17};
9
10// OR
11int i, j;
12for (i = 0; i < HEIGHT; i++) { // iterate through rows
13 for (j = 0; j < WIDTH; j++) { // iterate through columns
14 disp[i][j] = disp[i][j];
15 }
16}
1array = [[value] * lenght] * height
2
3//example
4array = [[0] * 5] * 10
5
6print(array)
1//Length
2int[][]arr= new int [filas][columnas];
3arr.length=filas;
4
5 int[][] a = {
6 {1, 2, 3},
7 {4, 5, 6, 9},
8 {7},
9 };
10
11 // calculate the length of each row
12 System.out.println("Length of row 1: " + a[0].length);
13 System.out.println("Length of row 2: " + a[1].length);
14 System.out.println("Length of row 3: " + a[2].length);
15 }