IncDec statements

未匹配的标注

The “++” and “–” statements increment or decrement their operands by the untyped constant 1. As with an assignment, the operand must be addressable or a map index expression.

IncDecStmt = Expression ( “++” | “–” ) .

The following assignment statements are semantically equivalent:

IncDec statement Assignment
x++ x += 1
x– x -= 1

本文章首发在 LearnKu.com 网站上。

上一篇 下一篇
讨论数量: 0
发起讨论 只看当前版本


暂无话题~