Listing 1 Illustrates pointers and indirection

/* pointer.c */
#include <stdio.h>

main()
{
   int i = 7, j = 8;
   int *ip, *jp;

   ip = &i;
   jp = &j;
   printf("Address %p (i) contains %d\n",ip,*ip);
   printf("Address %p (j) contains %d\n",jp,*jp);
   *ip = 9;
   printf("Now Address %p (i) contains %d\n",ip,i);
   *jp = 10;
   print("Now Address %p (j) contains %d\n",jp,j);
   return 0;
}

/* OUTPUT:
 * Address FFF4 (i) contains 7
 * Address FFF2 (j) contains 8
 * Now Address FFF4 (i) contains 9
 * Now Address FFF2 (j) contains 10 */

/* End of File */