栈内分配空间是从高地址向低地址分配
int a = 4;
int b = 0;
printf("%#x\n",&a);
printf("%#x\n",&b);
b = a;//将&b地址处的值改了 既B的内容改了
printf("%#x\n",&a);
printf("%#x\n",&b);
printf("%d\n",a);//
printf("%d\n",b);//4
--------------
int a = 4;
int b = 0;
printf("%#x\n",&a);
printf("%#x\n",&b);
b = a;
for(int i=10;i<11;i++)
{
b = i;
}
printf("%d\n",a);//4
printf("%d\n",b);//10
阅读(3355) | 评论(0) | 转发(0) |