Arduino-nested-loop

提供:Dev Guides
移動先:案内検索

Arduino-ネストされたループ

C言語では、1つのループを別のループ内で使用できます。 次の例は、概念を示しています。

ネストされたループの構文

for ( initialize ;control; increment or decrement) {
  //statement block
   for ( initialize ;control; increment or decrement) {
     //statement block
   }
}

for(counter = 0;counter <= 9;counter++) {
  //statements block will executed 10 times
   for(i = 0;i <= 99;i++) {
     //statements block will executed 100 times
   }
}