0
Can someone please explain how the rows and columns of arrays works?
C++ arrays
4 Antworten
+ 1
int arr[3][3] is assigned values
j 0 1 2. I, j Index values....
i ------------
0 [ 1 2 3 ]
1 [ 4 5 6 ] array values...
2 [ 7 8 9 ]
1 2 3 are 0th row values,
4 5 6 are 1st row values..
7 8 9 are 2nd row values...
1
4
5 are 0th column values..
....
2
5
8 are 1st column values..
And last, 2 nd column values are 3, 6, 9.
Columns are vertical collections in an array denoting there by j variable., while
rows are horizontal collections in array denoting by i variable there.. It index values start at 0.
0
Thanks Krishna
0
Sena Qwame sry I confused a bit, actually rows are horizontal ones, while columns are vertical ones... I updated all answer to clear representations. Take a look at again..
And you're welcome...
- 1
Thanks bro