Puzzle P29


Puzzle P29 — Pointing to a Changing Pointer

Of course, the pointer that a pointer to a pointer points to can be changed to point to a new thing:

#include  <stdio.h> 

void main ( void )
{
  int value = 77, num = 99 ;
  int *pv ;
  int **ppi ;

  ppi = &pv;
  
  pv  = &value;
  printf("**ppi = %d\n", **ppi );

  pv  = &num;
  printf("**ppi = %d\n", **ppi );

}


What does the program write?



Previous Page        Answer         Next Page         Home