Q:

We can use the subscript operator on any pointer, as long as that pointer points to an element (or one past the last element) in an array

0

We can use the subscript operator on any pointer, as long as that pointer points to an element (or one past the last element) in an array.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

int *p = &ia[2]; // p points to the element indexed by 2
int j = p[1]; // p[1] is equivalent to *(p + 1),
// p[1] is the same element as ia[3]
int k = p[-2]; // p[-2] is the same element as ia[0]

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now