Skip to content

Latest commit

 

History

History
66 lines (43 loc) · 977 Bytes

File metadata and controls

66 lines (43 loc) · 977 Bytes
title categories subCategories
continue
Structure
제어 구조

continue

설명

continue 문은 루프(for, while, 또는 do…​while)의 현재 반복의 나머지를 건너뛴다.
루프의 조건식을 체크하고 다른 일련의 반복을 진행한다.

예제 코드

아래 코드는 0에서 255까지의 코드 값을 PWMpin 에 쓰지만, 41에서 119 의 범위 값은 건너뛴다.

for (int x = 0; x <= 255; x ++) {
  if (x > 40 && x < 120) {  // 값 중 건너뛸 것을 만듦
    continue;
  }

  analogWrite(PWMpin, x);
  delay(50);
}

더보기