I only want to fill in the top and bottom row of an uninitialised array:
for (int i = 0; i < ROWS; i++) {
for (int j = 0; j < COLUMNS; j++) {
if (i == 0 || i == (ROWS - 1)) {
values[i][j] = i;
}
}
}
However, when I do so, it fills in all the rows in between with 0:
0000000000
0000000000
0000000000
0000000000
4444444444
Why is this the case?