Pointer to Pointer in C

Pointer to Pointer in C

In this program, you will learn about the concept of pointer to pointer and get the example code of pointer to pointer in c programming.

What is pointer to pointer

Pointer to pointer is a type of variable that stores the address of another pointer. A double pointer is another name for it. It is used to send the address of a pointer to a function or to pass a pointer by reference.

For example:

int a = 5;
int *b;
int **c;

b = &a; // b points to the address of a
c = &b; // c points to the address of b

In above example, c is a pointer to a pointer. It stores the address of b, which is a pointer to the integer variable a.

Pointer to Pointer in C example

Output

Value of a: 5
Value of *p: 5
Value of **pp: 5

 

 

 

Check out our other C programming Examples

 

 

 

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top