how to loop though 2d-array horizontally from left to right.
so when i loop though like 1,2,3,4,5,6,7,8
i just want to make sure this loop is doing what i think it does?
so when i loop though like 1,2,3,4,5,6,7,8
i just want to make sure this loop is doing what i think it does?
Code:
int array[][] = {{1,2,3,4},
{5, 6, 7, 8}};
for (int y= 0; y< array.length; y++) {
for (int x= 0; x < array[y].length; x++) {
array[y][x] == 2
}
}
Comment