Pointers and Indexing

A consequence of pointer arithmetic and the equivalence of array names and a pointer to the first element of the array is:

*(a+i) is equivalent to a[i]

a+i is equivalent to &a[i]

For example:

int squares[SIZE];

for (i = 0; i < SIZE; i++)
    *(squares + i) = i*i;

Index