我尝试了以下c代码。
void checkPointers () {
int a[10];
int *p = a;
printf("\n the value of p is \t %p \n",p);
printf(" the location of p is \t %p \n", &p);
printf(" the value of a is \t %p \n",a);
printf(" the location of a is\t %p \n", &a);
}
它告诉我的结果是......
the value of p is 0x7ffd6a7ce1b0
the location of p is 0x7ffd6a7ce1a8
the value of a is 0x7ffd6a7ce1b0
the location of a is 0x7ffd6a7ce1b0
输出显示了预期的p的不同值和位置,但是在数组变量a的情况下,它将值和位置显示为相同。对于我不知道的数组变量有什么特殊情况吗?