fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(int argc, char *argv[]) {
  5. int i=10,k;
  6. int *ptr1;
  7. printf(" Var-Name Address Content \n");
  8. printf(" ========= ========= ========== \n");
  9. printf(" i %d %d \n",&i,i);
  10. printf(" k %d ? \n",&k);
  11. ptr1=&i; /* 將變數i的記憶位址存入ptr1內 */
  12. printf(" ptr1 %d %d \n",&ptr1,ptr1);
  13. k=*ptr1; /* 將存放在ptr1內(即變數i的位址)所儲存的資料10指定給變數k */
  14. printf(" k %d %d \n",&k,*ptr1);
  15. system("PAUSE");
  16. return 0;
  17. }
  18.  
Success #stdin #stdout #stderr 0.01s 5280KB
stdin
8
stdout
 Var-Name   Address    Content  
 ========= ========= ========== 
     i     -704949464     10    
     k     -704949460      ?    
    ptr1   -704949456     -704949464    
     k     -704949460     10    
stderr
sh: 1: PAUSE: not found