标签:col 强制转换 logs printf include com size 技术分享 地址
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int i = 10;
int *p = &i;
printf("i = %d\n",i);
printf("i的地址 = %d\n",p);
/* 2686776是变量i的地址,
int*是强制转换2686776为指针类型,相当于指针p,
*(int*)2686776,(int*)相当于找到了变量i的地址,
*(int*)相当于找到了i,然后就对i的值进行更改
*/
*(int*)2686776 = 20;
printf("i = %d\n",i);
}
标签:col 强制转换 logs printf include com size 技术分享 地址
原文地址:http://www.cnblogs.com/liangjinjie/p/7600441.html