Pointer to Pointer

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

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:

see the syntax of pointer to pointer.
int **p2;

pointer to pointer example

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

you can see in the above figure, p2 contains the address of p (bbb2) and p contains the address of number variable (bbb5).
#include <stdio.h>   
void main() {        
int number= 40;    
int *p;   //pointer to int  
int **p2;  //pointer to pointer      
p=&number;  //stores the address of number variable    
p2=&p;  
printf("Address of number variable is %x \n",&number);    
printf("Address of p variable is %x \n",p);    
printf("Value of *p variable is %d \n",*p);    
printf("Address of p2 variable is %x \n",p2);    
printf("Value of **p2 variable is %d \n",**p);            
   }        
Output:
Address of number variable is bbb5
Address of p variable is bbb5
Value of *p variable is 40
Address of p2 variable is bbb2
Value of **p variable is 40