怎么实现*point_t[1]=20;//获取指针数组point的地址
如何实现*point_t[1]=20;//获取指针数组point的地址
#include <stdio.h>
void test()
{
int* point[2];
int temp_o = 10;
int temp_t = 20;
point[0] = &temp_o;
point[1] = &temp_t;
int** point_t = *(int***)&point;
printf("%d\n",*point_t[2]);//为啥*point_t[2]=20,明明数组就二元素。
//printf("%d\n",**point_t[2]);//为啥**会错误
}
int main()
{
test();
}
------解决方案--------------------
#include <stdio.h>
void test()
{
int* point[2];
int temp_o = 10;
int temp_t = 20;
point[0] = &temp_o;
point[1] = &temp_t;
int** point_t = *(int***)&point;
printf("%d\n",*point_t[2]);//为啥*point_t[2]=20,明明数组就二元素。
//printf("%d\n",**point_t[2]);//为啥**会错误
}
int main()
{
test();
}
------解决方案--------------------