Puascal hom twg yog siv los tshaj tawm ib qho array?

Cov txheej txheem:

Puascal hom twg yog siv los tshaj tawm ib qho array?
Puascal hom twg yog siv los tshaj tawm ib qho array?
Anonim

Tau tshaj tawm ib qho array hauv Pascal, tus programmer tuaj yeem tshaj tawm hom thiab tom qab ntawd tsim qhov sib txawv ntawm cov array lossis ncaj qha tshaj tawm cov array sib txawv. type array-identifier=array[index-type] of element-type; Qhov twg, array-identifier - qhia lub npe ntawm hom array.

Koj tshaj tawm li cas?

Txoj kev niaj zaus tshaj tawm ib qho array yog tsuas yog kab npe hom, ua raws li lub npe sib txawv, ua raws li qhov loj me hauv cov kab lus, raws li hauv kab lus no: int Numbers[10]; Txoj cai no tshaj tawm ib qho array ntawm 10 integers. Thawj lub ntsiab tau txais qhov ntsuas 0, thiab lub caij kawg tau txais qhov ntsuas 9.

hom kev tshaj tawm yog dab tsi?

Array tshaj tawm syntax yog qhov yooj yim heev. Cov syntax zoo ib yam li cov lus tshaj tawm tsis sib xws tshwj tsis yog lub npe sib txawv yuav tsum tau ua raws li cov ntawv sau los qhia qhov loj ntawm txhua qhov loj ntawm cov array. Daim ntawv qhia dav dav rau kev tshaj tawm array yuav yog: VariableType varName[dim1, dim2, …

Dab tsi yog array Koj tshaj tawm li cas?

Ib qho array yog ib qho kev sau ntawm cov ntsiab lus ntawm tib hom muab tso rau hauv qhov chaw nco sib txuas uas tuaj yeem hais txog tus kheej los ntawm kev siv qhov ntsuas rau tus cim tshwj xeeb. Tsib qhov tseem ceeb ntawm hom int tuaj yeem tshaj tawm ua ib qho array yam tsis tas yuav tshaj tawm tsib qhov sib txawv (txhua tus nrog nws tus kheej tus lej).

Dab tsi yog tshaj tawm hauvPascal?

Variable Declaration in Pascal

Type declaration indicates class or class of the types such as integer, real, etc., where the variable specifications qhia hom ntawm qhov muaj nuj nqis ib qho txawv txav tuaj yeem siv. Koj tuaj yeem sib piv hom kev tshaj tawm hauv Pascal nrog typedef hauv C.

Pom zoo: