do...while

Last revision:2024/05/16

名称

do…while

説明

do…while文は、制御式がループの最後に評価されることを除き、while文と同様の動作をする。このため、doループは最低でも1回は実行される。

書式

do {
  // statement block
} while (condition);

引数

conditiontrueかfalseと評価されるブール表現。

使用例

1
2
3
4
5
int x = 0;
do {
  delay(50);          // wait for sensors to stabilize
  x = readSensors();  // check the sensors
} while (x < 100);

参照

オリジナルのページ

https://docs.arduino.cc/language-reference/en/structure/control-structure/doWhile/

最終更新日

August 16, 2026

inserted by FC2 system