Output address and value : Variable Address « Language « C Tutorial






#include <stdio.h>

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

  number = 10;
  printf("\nnumber's address: %p", &number);            /* Output the address */
  printf("\nnumber's value: %d\n\n", number);           /* Output the value   */

  return 0;
}
number's address: 9a378
     number's value: 10








1.12.Variable Address
1.12.1.Output address and value
1.12.2.Using the & operator