++

Last revision:2024/05/14

名称

++

説明

変数を増分(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任意の変数。利用可能な型: int, long(unsignedも)。

戻り値

基の値(後置の場合)、もしくは、増分後の値(前置の場合)

使用例

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

参照

オリジナルのページ

https://docs.arduino.cc/language-reference/en/structure/compound-operators/increment/

最終更新日

August 16, 2026

inserted by FC2 system