To access the target value indirectly pointed to by a pointer to a pointer, apply the asterisk operator twice - C Pointer

C examples for Pointer:Pointer Variable

Description

To access the target value indirectly pointed to by a pointer to a pointer, apply the asterisk operator twice

Demo Code

#include <stdio.h>

int main(void)
{
   int x, *p, **q;

   x = 10;/*from   w w w.  j  a va 2  s  .c o  m*/
   p = &x;
   q = &p;

   printf("%d", **q); /* print the value of x */

   return 0;
}

Result


Related Tutorials