Using the Additive Operators
The following examples, which illustrate the addition and subtraction operators, use these declarations:
int i = 4, j; float x; float *px;
These statements are equivalent:
px = &x[4 + i]; px = &x + i;
The value of i is multiplied by the length of a float and added to &x. The resulting pointer value is the address of x.
j = &x[i] - &x[i-2];
In this example, the address of the third element of x (given by x[i–2]) is subtracted from the address of the fifth element of x (given by x[i]). The difference is divided by the length of a float; the result is the integer value 2.