Write a c program to transfer pointer values using numbers

Write a c program to transfer pointer values using numbers. The address of a value is stored in a pointer variable. The address of the pointer variable is stored in a pointer to a pointer. ** is used to execute a pointer to a pointer. A pointer is a variable whose value is the address of another variable that is the memory location’s direct address.

#include<stdio.h>
int main()
{
int var;
int *ptr;
int **pptr;
var = 10;
ptr = &var;
pptr = &ptr;
printf("\n\nValue of var = %d\n\n", var);
printf("\n\nValue available at *ptr = %d\n\n", *ptr);
printf("\n\nValue available at **pptr = %d\n\n", **pptr);
return 0;
}

 

Output:

Value of variable = 10

Value available at *ptr = 10

Value available at **pptr = 10