Answers for "2d array"

C++
5

2d array

int a[2][3]= {
        {1, 2, 3},
        {4, 5, 6}
    };
    
    cout << a[1][1]; // Output is 5
Posted by: Guest on May-27-2021
5

c fill 2d array

// Either
int disp[2][4] = {
  {10, 11, 12, 13},
  {14, 15, 16, 17}
};

// Or 
int disp[2][4] = { 10, 11, 12, 13, 14, 15, 16, 17};

// OR
int i, j;
for (i = 0; i < HEIGHT; i++) { // iterate through rows
  for (j = 0; j < WIDTH; j++) { // iterate through columns
    disp[i][j] = disp[i][j];
  }
}
Posted by: Guest on February-27-2020
6

2d arrays | java

int[][] arr = new int[row][column];
Posted by: Guest on April-22-2020
3

2d array python

array = [[value] * lenght] * height

//example
array = [[0] * 5] * 10

print(array)
Posted by: Guest on December-12-2020
6

matrix c declaration

int disp[2][4] = { 10, 11, 12, 13, 14, 15, 16, 17};
Posted by: Guest on March-18-2020
5

How to create a 2d array in java

int[][] arr = new int[m][n];
Posted by: Guest on November-20-2019

Browse Popular Code Answers by Language