fork download
  1. #include <stdio.h>
  2.  
  3. int main(int argc, char *argv[])
  4. {
  5. /* POINTER AS AN ADDRESS */
  6. int q = 10;
  7. int *p = &q;
  8.  
  9. printf("address of q is %p\n", (void *)&q);
  10. printf("p contains %p\n", (void *)p);
  11.  
  12. p = NULL;
  13. printf("NULL p now contains %p\n", (void *)p);
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 1788KB
stdin
Standard input is empty
stdout
address of q is 0xbfee4a18
p contains 0xbfee4a18
NULL p now contains (nil)