为何i和i2地址相同,值相同
#include <stdio.h> void a() { int i; printf("address of i in a is %d\n", &i); i=99; printf("value of i in a is %d\n", i); } void b() { int i2; printf("address of i2 in b is %d\n", &i2); printf("value of i2 in b is %d\n", i2); } int main() { a(); b(); return 0; }
输出结果:
address of i in a is 926478900
value of i in a is 99
address of i2 in b is 926478900
value of i2 in b is 99