Output value at the address : Variable Pointer « Language « C Tutorial






#include <stdio.h>

int main(void)
{
  int number = 0;                 
  int *pointer = NULL;            

  number = 10;

  pointer = &number;            

  printf("\npointer's value: %p", pointer);  /* Output the value (an address) */
  printf("\nvalue pointed to: %d\n", *pointer);       /* Value at the address */

  return 0;
}
pointer's value: 9a378
     value pointed to: 10








1.13.Variable Pointer
1.13.1.Output value at the address
1.13.2.Put values in the memory locations by using pointers