+ 1
2d array are complicated for can anyone help me by simply them to me
Arrays
3 Respuestas
+ 3
A 2d array is simply an array of arrays. Every index in the array is an array.
Another way that helps me when I'm using 2d arrays, is to think of it like this:
"I want to access the second array ( arr[1] ). In that array, I want the 3rd element: arr [1][4]". Left-to-right is equal to outer-to-inner."
+ 2
organise them into rows, columns in your code it will make them eaiser to understand
int i[][] = {{1,2,3}
{4,5,6}
{7,8,9}};
1 = [0][0]
2= [0][1]
3= [0][2]
or
1 = [0][0]
4 = [1][0]
7 = [2][0]
+ 1
take the 2d as int[4][5] here assume 4 as the 4 box in each box contains 5 box thats simple...