差异之间++ * argv的,ARGV * ++,*(的argv ++)和*(++的argv) [英] Difference between ++*argv, *argv++, *(argv++) and *(++argv)

查看:200
本文介绍了差异之间++ * argv的,ARGV * ++,*(的argv ++)和*(++的argv)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我正在学习C,并试图让我的头围绕这些说明。难道他们实际上是不同的?

Currently I am learning C and trying to get my head around these instructions. Are they actually different?

++*argv

*argv++

*(++argv)

*(argv++)

谢谢!

推荐答案

这是一个具有较高的precedence比指针解引用操作符,而不是preFIX增量后缀增量运算。所以这两者是等价的:

It's the postfix increment operator that has higher precedence than the pointer de-reference operator, not the prefix increment. So these two are equivalent:

*p++  *(p++)

的preFIX增量具有相同precedence为*,所以* ++ p递增指针,并且是相同的*(+ p)的。此外,++ * p为相同+ +(* p)的

The prefix increment has the same precedence as *, so *++p increments the pointer, and is the same as *(++p). Also, ++*p is the same as ++(*p).

这篇关于差异之间++ * argv的,ARGV * ++,*(的argv ++)和*(++的argv)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆