+=

[Compound Operators]

説明

これは、変数に別の定数または変数を加算するための便利なショートカットです。

構文

x += y; // equivalent to the expression x = x + y;

媒介変数

x: 変数。許可されるデータ型: intfloatdoublebyteshortlong.
y: 変数または定数。許可されるデータ型: intfloatdoublebyteshortlong.

x = 2;
x += 4; // x now contains 6

参照

  • [Language] Normal Addition

Language Reference Home

86Duinoリファレンスのテキストは、Arduinoリファレンスを改変したもので、Creative Commons Attribution-ShareAlike 3.0ライセンスに基づいてライセンスされています。リファレンス内のコードサンプルはパブリックドメインとして公開されています。

上部へスクロール