Ngamanye amaxesha, kunokufuneka siphumeze ikhowudi enye amaxesha amaninzi. Ngokubanzi, iinkcazo zenkqubo ziqhutywa ngokulandelelanayo: ingxelo yokuqala kumsebenzi yenzeka kuqala, ilandelwe yingxelo yesibini, njalo njalo.
Iilwimi zokucwangcisa zibonelela ngezakhiwo ezininzi zolawulo kwiindlela ezintsonkothileyo zokuphumeza.
Iingxelo zeLoop zisivumela ukuba siphumeze isiteyitimenti okanye iqela leengxelo ngokuphindaphindiweyo, kwaye oku kulandelayo yiflowutshati yeenkcazo zeluphu kwiilwimi ezininzi zokucwangcisa:
iipateni zebhayisikile
Ulwimi C lubonelela ngezi ntlobo ze-loop zilandelayo. Cofa kwikhonkco ukujonga uhlobo ngalunye ngeenkcukacha.
iipateni zebhayisikile | inkcazelo |
ngelixa ukuphindaphinda | Phinda iinkcazo okanye iqela leenkcazo xa imeko enikiweyo iyinyani. Ivavanya imeko phambi kokuphumeza umamkeli welophu. |
ukwenzela ukuphindaphinda | Ukwenza ulandelelwano lweenkcazo amaxesha amaninzi, ukwenza lula ikhowudi elawula ukuguquguquka kwe-loop. |
yenza ... ngelixa ukuphindaphinda | iyafana nengxelo ngelixa ngaphandle kokuba ivavanya imeko ekupheleni kwesifundo se-loop. |
indlwana loop | Sebenzisa iluphu enye okanye ngaphezulu kwiluphu yexesha, okanye wenze... ngelixa |
Ingxelo yolawulo lwelophu
Isiteyitimenti solawulo lwe-loop silutshintsha ulandelelwano lokuba ikhowudi yenziwe. Ngayo unokutsiba kwikhowudi.
C ulwimi lubonelela ngezi nkcazo zilandelayo zolawulo lwelophu. Cofa kwikhonkco ukuze ubone iinkcukacha zengxelo nganye.
ingxelo yolawulo | inkcazelo |
qhawula isigwebo | Ukuphelisa iluphu okanyetshintshaIngxelo, umjelo wenkqubo uyaqhubeka ukwenza ingxelo elandelayo elandela loop okanyetshintsha. |
qhubeka Ingxelo | Xelela umzimba welophu ukuba umise umjikelo ngoko nangoko kwaye uqale umjikelo olandelayo kwakhona. |
goto isigwebo | Dlulisela ulawulo kwingxelo ephawulweyo. Kodwa ungacebisi ukusebenzisa ingxelo ye-goto kwinkqubo. |
iluphu engapheliyo
Ukuba iimeko azizange zibe bubuxoki, ngoko i-loop iba yi-loop engapheliyo. I-for cycle ingasetyenziselwa ukuqonda imijikelo engapheliyo ngokwengqiqo yemveli . Kuba nawaphi na amabinzana amathathu enza iluphu ingeyomfuneko, ungashiya amanye amabinzana anemiqathango engenanto ukwenza iluphu engapheliyo.
umzekelo ophilayo
Intetho yoxhomekeko ithathwa njengenyani xa ingekho. Ungacwangcisa ixabiso lokuqala kunye nentetha eyongezelekayo, kodwa ngokubanzi, umdwelisi we C ukholisa ukusebenzisa i (;;) isakhiwo sokumela iluphu engapheliyo.
Umjikelo ongentla we-C ungowakwaShenzhen HDV Photoelectron Technology co., LTD., Umsebenzi wobugcisa besoftware., Kwaye inkampani idibanise iqela elinamandla lesoftware yezixhobo ezinxulumene nenethiwekhi (ezifana ne: ACI-ONU/ unxibelelwanoI-ONU/ okrelekreleI-ONU/ ifayibhaI-ONU/XPONI-ONU/GPONI-ONUnjl.). Kuwo wonke umthengi ulungele iimfuno ezikhethekileyo ozifunayo, vumela iimveliso zethu ukuba zikrelekrele kwaye zihambele phambili.