Nws yog qhov tsim nyog los pib qhov array thaum lub sijhawm tshaj tawm. Qhov no nqe lus tsis tseeb. … Tus lej tshaj tawm [SIZE] raug tso cai yog SIZE yog macro. Cov lus no muaj tseeb, vim tias MACRO tsuas yog hloov lub cim SIZE nrog tus nqi muab.
Peb puas tuaj yeem pib qhov array thaum lub sijhawm tshaj tawm?
Thaum Lub Sijhawm Tshaj Tawm
Thaum lub sijhawm tam sim ntawm array, peb tsis tas yuav qhia nws hom: int array={ 1, 2, 3, 4, 5 }; Nco ntsoov tias nws yog tsis tuaj yeem pib qhov array tom qab tshaj tawm siv txoj hauv kev no; kev sim ua li ntawd yuav ua rau muaj qhov yuam kev.
Yuav ua li cas yog qhov tsim nyog thaum lub sijhawm pib array?
Qhov twg ntawm cov no yuav tsum tau qhia thaum lub sijhawm pib ntawm array? Piav: None.
Puas arrays yuav tsum tau pib?
Koj tsis tas yuav pib ua txhua yam hauv ib qho array. Yog tias ib qho array yog ib feem pib, cov ntsiab lus uas tsis tau pib tau txais tus nqi 0 ntawm hom tsim nyog. Tib yam siv rau cov ntsiab lus ntawm arrays nrog lub sijhawm khaws cia zoo li qub.
Yuav ua li cas yog tias koj tsis pib qhov array?
Yog tias koj tsis pib tus lej hauv koj cov array, lawv tuaj yeem ua dab tsi. Siv qhov no es tsis txhob txuag koj yuav tsum tau voj hla lub array thiab muab txhua tus nqi rau 0. Yog tias koj txiav txim siab ntxig lwm tus lej, ces pib qhov array yuav tsis xav tau.