Being a two dimensional array, one loop would iterate through the first index set, and an inner loop would iterate through the second set.
Pseudo code:
1 2 3 4 5 6
|
loop {
loop {
i ++;
a[j][k] = i;
} k++
} j++
|
Examining the end result would show this in the array:
a[0][0] = 1, [1] = 2, [2] = 3, [3] = 4, [4] = 5
a[1][0] = 6, [1] = 7, [2] = 8, [3] = 9, [4] = 10
a[2][0] = 11, [1] = 12, [2] = 13, [3] = 14, [4] = 15
a[3][0] = 16, [1] = 17, [2] = 18, [3] = 19, [4] = 20
This is more for the second question, but knowing this, you can tackle the first. Expanding it out and filling it in as you go through the loops will help you conceptualize arrays.
Any of this help?