++ / --
出自YFRobotwiki
遞增或遞減某個變量
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-- ; // decrement x by one and returns the old value of x --x ; // decrement x by one and returns the new value of x
x: 整型或者長整型變量(包含無符號整型)
變量執行完遞增或遞減後的舊值和新值
x = 2; y = ++x; // x = 3, y = 3 y = x--; // x = 2, y = 3
|
更多建議和問題歡迎反饋至 YFRobot論壇