[email protected]_44_28_sles10sp1:~/code> cat test3.cpp
#include <stdio.h>
int main()
{
char a[5] = {0};
char *pa = a;
printf("a = %p, pa = %p, &a=%p, &pa=%p\n", a, pa, &a, &pa);
return 0;
}
[email protected]_44_28_sles10sp1:~/code> g++ test3.cpp
[email protected]_44_28_sles10sp1:~/code> ./a.out
a = 0xbfc1e73f, pa = 0xbfc1e73f, &a=0xbfc1e73f, &pa=0xbfc1e738
原因是为什么呢?
时间: 2024-12-29 17:10:50