Urgent help

This is a sample of array :

int data[3][3] = {{1,2,3} , {7,6,8} {2,5}}

Am I right in this :

1 - The value stored in int data[1][1] is 17
2 - The value stored in int data[2][2] is 26

seriously, its getting frustrating. IF I am wrong please do state the right answer :(
Arrays are indexed by 0, meaning position [0][0] holds [1] and so on up to 2.
EDIT: also just because 2 values are stored next to each other does not mean they become 1 number, I don't know if you were implying that as well.
EDIT EDIT: realized I'm a gibbon and amended my post.
Last edited on
To help you visualize the array, here's a 2D representation:

1 2 3
7 6 8
2 5 0

Calling data[r][c] accesses the element on row r and column c. Remember arrays start at index 0.

So, no, you aren't right for either guess.
Last edited on
Topic archived. No new replies allowed.