
|
Go to the first, previous, next, last section, table of contents.
ループを構成する文は, while 文, for 文, do 文
の 3 種類がある.
ループを抜け出す手段として,
break 文及び return 文がある. また, ループの制御を
ある位置に移す手段として continue 文がある.
-
break
break 文は, それを囲むループを一つだけ抜ける.
-
return
return 文は, 一般に函数から抜けるための文であり,
ループの中からでも有効である.
-
continue
continue 文は, ループの本体の文の末端に制御を移す.
例えば for 文では, 最後の式並びの実行を行い, while
文では条件式の判定に移る.
Go to the first, previous, next, last section, table of contents.
|