Access Value Using pptr
Finally, we will access the value of var
using the pointer to pointer variable pptr
.
printf("\nValue of var = %d\n", var);
printf("\nValue available at *ptr = %d\n", *ptr);
printf("\nValue available at **pptr = %d\n", **pptr);
The first printf
statement will print the value of variable var
.
The second printf
statement will print the value available at the memory address stored in ptr
, which should be the value of var
.
The third printf
will print the value available at the memory address stored in pptr
, which should be the value of ptr
, and then dereferencing twice to get the value of var
.