[comp.lang.c] Get this pointer stuff over wit

root@mirror.TMC.COM (05/20/89)

You say that it is integer arithmatic.  But it is not.  True, you can
use the pointers the same as integers, but when you add 1 to a pointer
you don't always get the next integer value.  

When you add a 1 (or any number) to a pointer, the value increases
by the size of the data that you are pointing to.

In normal integer arithmatic, if you have 132 and add 1 to it you get 133.
In pointer arithmatic, if you have a pointer to a float at location 132
and add 1 to it you may get 134.  If you have a data item, such as a structure,
that is 12 bytes large and have a pointer pointing to location 1453 and you
add 1 to the pointer you will get the value 1465.  This is not integer math.

You are right, you can use the pointers like integers, and this is the real
beauty and power of C; but you cannot say that pointer arithmatic is really
integer arithmatic.