Pointers and Arrays
There is an important relation between pointers and arrays. By defining:int a[10];“a” by itself is of type (int *) - a pointer to int, and has the value &a[0] (the address of a[0]).So we can do the following:int *pa = a;
since pointers are just numbers (i.e. numeric memory addresses) we can do arithmetic operation on them:int *pb = pa+1; /* now pb points to a[1] */*pb = 1; /* now a[1] = 1 */*(pb + 2) = 3; /* now a[3] = 3 */