trainingtrains Logo

91-9990449935

 0120-4256464

C Pointer to Pointer

In C pointer to pointer concept, a pointer refers to the address of another pointer.

In c language, a pointer can point to the address of another pointer which points to the address of a value. Let's understand it by the diagram given below:

pointer to pointer in c

Let's see the syntax of pointer to pointer.

C pointer to pointer example

Let's see an example where one pointer points to the address of another pointer.

C pointer to pointer example

As you can see in the above figure, p2 contains the address of p (fff2) and p contains the address of number variable (fff4).

Output

Address of number variable is fff4
Address of p variable is fff4
Value of *p variable is 50
Address of p2 variable is fff2
Value of **p variable is 50