p has data type int*

 

A[2] is the third element of A

&A[2] is the address of the third element of A, so the data type of &A[2] is int*

so we can assign: p = &A[2]; so that p points to the third element of A

 

Alternatively,

A is a pointer that points to the first element of the array A

using pointer addition, A + 2 points to the third element of A

so we can assign: p = A + 2; so that p points to the third element of A

 

Once p points to the right value in A, we can print the value by dereferencing p:

printf (%d\n, *p);