哪位高手能解释下,取指针数组名的地址 &与不加地址相同?//数组名是常量的原因
谁能解释下,取指针数组名的地址 &与不加地址相同?//数组名是常量的原因?
#include <stdio.h>
void test()
{
int* point[2];
int temp_o = 10;
int temp_t = 20;
point[0] = &temp_o;
point[1] = &temp_t;
printf("%p\n",&point);
printf("%p\n",point);
}
int main()
{
test();
}
------解决方案--------------------
C中规定数组名直接使用就是表示地址。。。这个数组的首地址
#include <stdio.h>
void test()
{
int* point[2];
int temp_o = 10;
int temp_t = 20;
point[0] = &temp_o;
point[1] = &temp_t;
printf("%p\n",&point);
printf("%p\n",point);
}
int main()
{
test();
}
------解决方案--------------------
C中规定数组名直接使用就是表示地址。。。这个数组的首地址