fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int i=10;
  5. printf("iの中身:%d iのアドレス:%p←!!\n", i, &i);
  6. int *p=NULL;
  7. printf("代入前〜\npの中身:%p(※未定義) pのアドレス:%p\n", p, &p);
  8. p=&i;
  9. printf("代入後〜\npの中身:%p←!! pのアドレス:%p\npが参照する値:%d\n", p, &p, *p);
  10. return 0;
  11. }
Success #stdin #stdout 0s 2112KB
stdin
Standard input is empty
stdout
iの中身:10 iのアドレス:0xbfe0cdc8←!!
代入前〜
pの中身:(nil)(※未定義) pのアドレス:0xbfe0cdcc
代入後〜
pの中身:0xbfe0cdc8←!! pのアドレス:0xbfe0cdcc
pが参照する値:10