为什么指向的地方的地址一直在变化?导致这种情况发生的内存中发生了什么,还是我的printf
陈述有问题?
#include <stdio.h>
#include <stdlib.h>
int main()
{
char blocks[3] = {'A', 'B', 'C'};
char *ptr = &blocks[0];
char temp;
temp = blocks[0];
printf(" %c, %d ", temp, &temp);
return 0;
}
输出
A, 1764940775
A, 1731746791