#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
int i=10,k;
int *ptr1;
printf(" Var-Name Address Content \n"); printf(" ========= ========= ========== \n"); ptr1=&i; /* 將變數i的記憶位址存入ptr1內 */
printf(" ptr1 %d %d \n",&ptr1
,ptr1
); k=*ptr1; /* 將存放在ptr1內(即變數i的位址)所儲存的資料10指定給變數k */
printf(" k %d %d \n",&k
,*ptr1
); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCmludCBtYWluKGludCBhcmdjLCBjaGFyICphcmd2W10pIHsKCWludCBpPTEwLGs7CglpbnQgKnB0cjE7CglwcmludGYoIiBWYXItTmFtZSAgIEFkZHJlc3MgICAgQ29udGVudCAgXG4iKTsKCXByaW50ZigiID09PT09PT09PSA9PT09PT09PT0gPT09PT09PT09PSBcbiIpOwoJcHJpbnRmKCIgICAgIGkgICAgICVkICAgICAlZCAgICBcbiIsJmksaSk7CglwcmludGYoIiAgICAgayAgICAgJWQgICAgICA/ICAgIFxuIiwmayk7CglwdHIxPSZpOyAgICAvKiDlsIforormlbhp55qE6KiY5oa25L2N5Z2A5a2Y5YWlcHRyMeWFpyAqLwoJcHJpbnRmKCIgICAgcHRyMSAgICVkICAgICAlZCAgICBcbiIsJnB0cjEscHRyMSk7CglrPSpwdHIxOyAvKiDlsIflrZjmlL7lnKhwdHIx5YWnKOWNs+iuiuaVuGnnmoTkvY3lnYAp5omA5YSy5a2Y55qE6LOH5paZMTDmjIflrprntaborormlbhrICovCglwcmludGYoIiAgICAgayAgICAgJWQgICAgICVkICAgIFxuIiwmaywqcHRyMSk7CglzeXN0ZW0oIlBBVVNFIik7CQoJcmV0dXJuIDA7Cn0K