|
-
June 21st, 2011, 09:26 PM
#1
please help me with this small question about array
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].
Is the answer correct? Shouldn't it be twoD[1][3] instead?
Please let me know your opinion. Thanks.
-
June 21st, 2011, 09:59 PM
#2
Re: please help me with this small question about array
It's a subtle question which could be interpreted either way.
If they were asking for the fourth element of the second subarray, you would be absolutely correct. Since they're identifying them by number, it is less clear what is intended.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|