Puzzle P26


Puzzle P26 — Follow two links

Pointers can point to a place which points to a place in which store a value. Here is a program where two links are followed to get to the storage location.

#include  <stdio.h> 

void main ( void )
{
  int value;
  int *pv;
  int **ppv;

  pv  = &value;
  ppv = &pv;

  **ppv = 47;  /* **ppv on the left designates a location */

  printf("value = %d\n", value );
  printf("**ppv   = %d\n", **ppv );

}

What does the program write?



Previous Page        Answer         Next Page         Home