| Description |
|
Controls a sequence of repetitions. A for() structure has three parts: init, test, and update. Each part must be separated by a semi-colon ";". The loop continues until the test evaluates to false. When a for() structure is executed, the following sequence of events occurs: 1. The init statement is executed 2. The test is evaluated to be true or false 3. If the test is true, jump to step 4. If the test is False, jump to step 6 4. Execute the statements within the block 5. Execute the update statement and jump to step 2 6. Exit the loop.
반복적인 실행을 제어
합니다. for() 문은 init, test
그리고 update 의 3 부분으로
구성됩니다. 각 부분은
세미컬론 ";"으로
구분됩니다. 루프는
테스트 결과가 FALSE 이면
계속됩니다. for() 구조가
실행되면 다음
연속적인 동작이
일어납니다.
1. init 초기화 문이
실행된다.
2. 검사 조건이 실행되며
참, 거짖을 판단한다.
3. 검사 결과가 참이면
스텝 4 로 간다. 검사
결과가 거짖이면 스텝 6
으로 간다.
4. 블록내의 무을
실행한다.
5. 업데이트 문을
실행하고 스텝 2 로
점프한다.
6 루프문을 종료한다.
|