Help with array question?

Mar 28, 2013 at 1:31am
closed account (EApGNwbp)
What is the index of the first element in the array declared below?

const int SIZE = 3;
int nums2[SIZE] = {1, 2, 3};
Mar 28, 2013 at 1:32am
The first index of an array is always 0.
Mar 28, 2013 at 1:36am
closed account (EApGNwbp)
@yanson
and this question what would it be?

What is the index of the last element in the array declared below?

const int SIZE = 3;
int nums2[SIZE] = {1, 2, 3};
Mar 28, 2013 at 1:39am
You should be able to figure that out from the information you've been given. The first index is 0 (the first element), and there are 3 elements. So what is the last index?
Topic archived. No new replies allowed.