Pointer to array


A pointer variable can store address of other variable.
Not only can a pointer store the address of a single variable, it can also store the address of cells of an array.
    int arr[5];
    int *p;
    p=arr;

Here; ;
   p is a pointer variable , and arr is a array.
  When code; p=arr will be excuted.
  p stores the address of the first elements of array in variable p.

   We can write;  p=arr
                                or
                            p= &arr[0] both are same.

Pointer to array


pointer to array