什么是i +++增量在c ++ [英] What is i+++ increment in c++
问题描述
这是一个语法错误。
任何人都可以告诉我什么是i +++在c ++中递增的过程。 p>使用最大限制规则 i +++
被标记为:
i ++ +
/ pre>
最后
+
是一个二进制加法运算符。但显然它没有两个操作数导致解析器错误。
编辑:
注释的问题:我们可以有
i ++++ j
?
:
i ++ ++ j
这又是一个语法错误,因为
++
是一元运算符。
在类似行
i +++++ j
被扫描器标记为:i ++ ++ + j
( c ++)+ j 这也是错误的,因为
i ++
不是一个左值并使用/ code>不允许。
can anyone tell me what is the process of i+++ increment in c++.
解决方案It is a syntax error.
Using the maximum munching rule
i+++
is tokenized as:i ++ +
The last
+
is a binary addition operator. But clearly it does not have two operands which results in parser error.EDIT:
Question from the comment: Can we have
i++++j
?It is tokenized as:
i ++ ++ j
which again is a syntax error as
++
is a unary operator.On similar lines
i+++++j
is tokenized by the scanner as:i++ ++ + j
which is same as
((i++)++) + j
which again in error asi++
is not a lvalue and using++
on it is not allowed.这篇关于什么是i +++增量在c ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!