Puzzle P21


Puzzle P21 — Pointer to a Pointer

What does the following code write to the monitor?

#include  <stdio.h> 

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

  value = 32;
  pv = &value;
  ppv = &pv;

  printf("value = %d\n", value );
  printf("*pv   = %d\n", *pv );
  printf("*( *ppv ) = %d\n", *( *ppv ) );
  
  system("pause");
}


Previous Page        Answer         Next Page         Home