Pointer Arithmetic In C Language
An integer operand can be used with a pointer to move it to a point / refer to some other address in the memory.

In a 16 bit machine, size of all types of pointer, be it int*, float*, char* or double* is always 2 bytes. But when we perform any arithmetic function like increment on a pointer, changes occur as per the size of their primitive data type.
Consider an int type ptr as follows :

Assume that it is allotted the memory address 65494 increment value by 1 as follows.

++ and -- operators are used to increment, decrement a ptr and commonly used to move the ptr to next location. Now the pointer will refer to the next location in the memory with address 65496.

C language automatically adds the size of int type (2 bytes) to move the ptr to next memory location.

mptr = mtpr + 1
= 65494 + 1 * sizeof (int)
= 65494 + 1 * 2

Similarly an integer can be added or subtract to move the pointer to any location in RAM. But the resultant address is dependent on the size of data type of ptr.

The step in which the ptr is increased or reduced is called scale factor. Scale factor is nothing but the size of data type used in a computer.

We know that, the size of

float = 4
char = 1
double = 8 and so on

Rules for pointer operation :

The following rules apply when performing operations on pointer variables

1. A pointer variable can be assigned to address of another variable.

2. A pointer variable can be assigned the values of other pointer variables.

3. A pointer variable can be initialized with NULL or 0 values.

4. A pointer variable can be prefixed or post fixed with increment and decrement operator.

5. An integer value may be added or subtracted from a pointer variable.

6. When two pointers points to the same array, one pointer variable can be subtracted from another.

7. When two pointers points to the objects of same data types, they can be compared using relational

8. A pointer variable cannot be multiple by a constant.

9. Two pointer variables cannot be added.

10. A value cannot be assigned to an arbitrary address.