Pointer arithmetic is not a separate data type. Pointer arithmetic are some arithmetic operations that can be done with pointers:

1.) Adding int to a pointer:

If you have pointer to some data type for example:

int* ptr;

and some int value i

then expression

*(ptr + i) is same as ptr[i].

In other words if you add integer (i) to a pointer (ptr), you will get a pointer to a place a memory i positions from ptr.

The same goes with subtraction.

|----------------------------------------------------------------------|

| int1 | int 2 | int 3 | int 4 |

|----------------------------------------------------------------------|

^ ^

ptr ptr+3

2.) Subtracting to pointers:

To subtract two pointers, they must be same type.

For example:

double *ptr1, *ptr2;

then ptr2-ptr1 is an int value which represent number of positions between these two pointers.

|----------------------------------------------------------------------|

| double 1 | double 2 | double 3 | double 4 |

|----------------------------------------------------------------------|

^ ^

ptr1 ptr2

ptr2 - ptr1 = 3!

In previous explanation, when I say position I think of number of bytes that given data type ocypies.

3.) ptr++; and ++ptr;

Have same effect on ptr like ptr = ptr+1;

Same thing with ptr--; and --ptr;

4.) Two pointers can't be added, multiplied, divided,...

5.) Poiner arithmetics is alternative way for accessing elements of an static or dynamicly allocated array:

For example:

int a[100];

int* b = new int[100];

then you can access i-th element of a with both: a[i] and *(a+i).

then you can access i-th element of b with both: b[i] and *(b+i).

note that a+i and b+i are addresess of i-th element in arrays a and b respectivly.

I hope, I have been helpful.

Sorry, for my awkward english. :-)

1.) Adding int to a pointer:

If you have pointer to some data type for example:

int* ptr;

and some int value i

then expression

*(ptr + i) is same as ptr[i].

In other words if you add integer (i) to a pointer (ptr), you will get a pointer to a place a memory i positions from ptr.

The same goes with subtraction.

|-------------------------

| int1 | int 2 | int 3 | int 4 |

|-------------------------

^ ^

ptr ptr+3

2.) Subtracting to pointers:

To subtract two pointers, they must be same type.

For example:

double *ptr1, *ptr2;

then ptr2-ptr1 is an int value which represent number of positions between these two pointers.

|-------------------------

| double 1 | double 2 | double 3 | double 4 |

|-------------------------

^ ^

ptr1 ptr2

ptr2 - ptr1 = 3!

In previous explanation, when I say position I think of number of bytes that given data type ocypies.

3.) ptr++; and ++ptr;

Have same effect on ptr like ptr = ptr+1;

Same thing with ptr--; and --ptr;

4.) Two pointers can't be added, multiplied, divided,...

5.) Poiner arithmetics is alternative way for accessing elements of an static or dynamicly allocated array:

For example:

int a[100];

int* b = new int[100];

then you can access i-th element of a with both: a[i] and *(a+i).

then you can access i-th element of b with both: b[i] and *(b+i).

note that a+i and b+i are addresess of i-th element in arrays a and b respectivly.

I hope, I have been helpful.

Sorry, for my awkward english. :-)