--

Last revision:2024/05/14

名称

- -

説明

変数を減分(1減らす)する。

書式

x--; // decrement x by one and returns the old value of x

--x; // decrement x by one and returns the new value of x

引数

x任意の変数。利用可能な型: int, long(unsignedも)。

戻り値

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

使用例

1
2
3
x = 2;
y = --x;  // x now contains 1, y contains 1
y = x--;  // x contains 0, but y still contains 1

参照

オリジナルのページ

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

最終更新日

July 22, 2026

inserted by FC2 system