关于&*和*&运算后的结果
#include <stdio.h>
int main(int argc, char const *argv[])
{
int a = 3;
int *p = &a;
printf("%d\n", *p);
int b = *p + 3;
int point = &*p;
int c = *&b;
printf("%d, %x, %d\n", b, point, c);
return 0;
}
gcc编译运行发现,运行结果
对比变量point和c发现,对于&*和*&运算是一种抵消,也就是说“解引用”和“取地址”运算合一相互抵消,变相可以理解为int point = p;int c = b;
point和c分别保存p的值、b的值