Is the answer correct? Shouldn't it be twoD[1][3] instead?Write an expression that accesses element 4 in subarray 2 in a two-dimensional array called twoD. The answer given in the book is: twoD[2][4].
Please let me know your opinion. Thanks.
Is the answer correct? Shouldn't it be twoD[1][3] instead?Write an expression that accesses element 4 in subarray 2 in a two-dimensional array called twoD. The answer given in the book is: twoD[2][4].
Please let me know your opinion. Thanks.
I'm an outright beginner. Using Win XP Pro and Code::Blocks. Be nice to me, please.
Element 4 does not necessarily mean the same thing as the fourth element. Element 4 is (or can be interpreted by convention to be) [4], while the fourth element is [3].
The answer given in your boot is correct, for a declaration. but accessing that spot in the array would be your answer.
Thanks, tabstop, Whyrusleeping.Write an expression that accesses element 4 in subarray 2 in a two-dimensional array called twoD. The answer given in the book is: twoD[2][4].
The keyword is "accesses". That confuses me. To access it I think my version is more correct. What do you say? Please have a second look. Thank you.
I'm an outright beginner. Using Win XP Pro and Code::Blocks. Be nice to me, please.
The trouble is . . .
C++ programmers count like this: 0 1 2 3 4
The rest of the world counts like this: 1 2 3 4 5
When you are talking about programming I encourage you to count like a programmer. That's why the book isn't wrong.
Also, I think it's a mistake to assume the question is wanting a declaration. A declaration is a statement, while the question asks for an expression, and declarations do not access anything.