Array or array element in C?
- by user3646717
I'm reading a book about C programming, and I'm not sure whether there is an error in the book or not. Its about arrays and has the following array example:
Then it says:
The following statements sets all the elements in row 2 of array to zero:
for( column = 0; column <= 3; column++)
a[ 2 ][ column ] = 0;
The preceding for statement is equivalent to the assignment statements:
a[ 2 ][ 0 ] = 0;
a[ 2 ][ 1 ] = 0;
a[ 2 ][ 2 ] = 0;
a[ 2 ][ 3 ] = 0;
Shouldn't it say "The following statements sets all the elements in row 1 to zero"?. Because if I say a[ 3 ] I am talking about the row 2, if I say a[ 2 ] I am talking about row 1 and if I say a[ 1 ] I am talking about row 0.