Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/56.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
什么';C中*(a[1])和*(*a&x2B;1)的区别是什么?_C_Pointers - Fatal编程技术网

什么';C中*(a[1])和*(*a&x2B;1)的区别是什么?

什么';C中*(a[1])和*(*a&x2B;1)的区别是什么?,c,pointers,C,Pointers,当我在gdb中调试它们时,它们似乎是不同的 (gdb) p order[1] $16 = (struct order_s *) 0x746440 (gdb) p *order+1 $17 = (struct order_s *) 0x746430 (gdb) p *order $18 = (struct order_s *) 0x746420 C中的*a[1]和*(*a+1)有什么区别?操作顺序a[1]与*(a+1)相同。因此,*a[1]与*(*(a+1))相同。如果你有*(*a+

当我在gdb中调试它们时,它们似乎是不同的

 (gdb) p order[1]
 $16 = (struct order_s *) 0x746440
 (gdb) p *order+1
 $17 = (struct order_s *) 0x746430
 (gdb) p *order
 $18 = (struct order_s *) 0x746420

C中的*a[1]和*(*a+1)有什么区别?

操作顺序
a[1]
*(a+1)
相同。因此,
*a[1]
*(*(a+1))
相同。如果你有
*(*a+1)
,那么你实际上是在做
*(a[0]+1)