Mega Code Archive

 
Categories / C Tutorial / Language
 

Output value at the address

#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