小编skc*_*skc的帖子

C指针的"**&ptr"和"2**ptr"是什么意思?

我是C的新手.我需要通过以下代码了解屏幕上打印的每个值的含义:

#include<stdio.h>

int main() 
{
     int x = 10;
     int *ptr = &x;
     printf("%d %d %d\n", *ptr,**&ptr, 2**ptr);
     return 0;
}
Run Code Online (Sandbox Code Playgroud)

输出(GCC):

10 10 20
Run Code Online (Sandbox Code Playgroud)

在这里,我声明了变量xptr指向x变量.所以,*ptr印刷价值x.但我不明白的价值**&ptr2**ptr.

提前致谢.

c pointers reference dereference

8
推荐指数
2
解决办法
1723
查看次数

标签 统计

c ×1

dereference ×1

pointers ×1

reference ×1