サイト内検索

検索

Shares

Table of Content

++

[Compound Operators]

説明

Increments the value of a variable by 1.

構文

x++; // increment x by one and returns the old value of x
++x; // increment x by one and returns the new value of x

媒介変数

x: variable. Allowed data types: intlong (possibly unsigned).

戻り値

The original or newly incremented value of the variable.

x = 2;
y = ++x;  // x now contains 3, y contains 3
y = x++;  // x contains 4, but y still contains 3

Language Reference Home

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

上部へスクロール