[英]Priority of C++ operators “&” and “->”
As far as precedence rules go, I've always liked the one put forth by Steve Oualline in "Practical C": 至于优先规则,我总是喜欢Steve Oualline在“Practical C”中提出的那个:
There are fifteen precedence rules in C (&& comes before || comes before ?:). C中有十五个优先级规则(&&在||之前出现?:)。 The practical programmer reduces these to two: 实际的程序员将这些减少到两个:
1) Multiplication and division come before addition and subtraction. 1)乘法和除法在加法和减法之前。
2) Put parentheses around everything else. 2)将括号括在其他所有地方。
May I suggest that you resolve such questions using a test programme? 我建议您使用测试程序解决这些问题吗? That has the advantage that you will know for sure that the answer is correct for your implementation, and you are not exposed to the risk of badly answered questions. 这样做的好处是,您可以确定答案对于您的实施是正确的,并且您不会面临难以回答的问题的风险。
&(行向>计数)
-> has a higher priority than & (address of). - >的优先级高于&(地址)。 So your expression would be evalutated as &(row->count) 所以你的表达式将被评估为&(row-> count)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.