In an unsafe context, the + operator (14.7.4) and -operator (14.7.5) can be applied to values of all pointer types except void*. Thus, for every pointer type T*, the following operators are implicitly defined:
Given an expression P of a pointer type T* and an expression N of type int, uint, long, or ulong, the expressions P + N and N + P compute the pointer value of type T* that results from adding N * sizeof(T) to the address given by P. Likewise, the expression P -N computes the pointer value of type T* that results from subtracting N * sizeof(T) from the address given by P.
Given two expressions, P and Q, of a pointer type T*, the expression P -Q computes the difference between the addresses given by P and Q and then divides that difference by sizeof(T). The type of the result is always long. In effect, P -Q is computed as ((long)(P) -(long)(Q)) / sizeof(T).
[Example: For example: which produces the output: end example]
If a pointer arithmetic operation overflows the domain of the pointer type, the result is truncated in an implementation-defined fashion, but no exceptions are produced.