Puas yog Std ib daim ntawv teev npe?
Puas yog Std ib daim ntawv teev npe?

Video: Puas yog Std ib daim ntawv teev npe?

Video: Puas yog Std ib daim ntawv teev npe?
Video: Yasmi - Yog Muaj Ib Hnub 2024, Kaum ib hlis
Anonim

std :: lis . std :: lis yog ib lub thawv uas txhawb nqa lub sij hawm tas li thiab tshem tawm cov khoom los ntawm txhua qhov chaw hauv lub thawv. Nws feem ntau yog siv raws li kev sib txuas ob zaug lis . Piv rau std ::forward_list lub thawv no muab kev muaj peev xwm iteration bidirectional thaum ua qhov chaw tsawg dua.

Tsis tas li ntawd, daim ntawv teev npe hauv C ++ yog dab tsi?

Sau npe . Cov npe yog cov ntim khoom sib txuas uas tso cai rau lub sij hawm tas li ntxig thiab tshem tawm cov haujlwm nyob qhov twg hauv qhov sib lawv liag, thiab rov ua dua hauv ob qho lus qhia. Sau npe ntim tau siv raws li ob npaug-txuas cov npe ; Ob npaug txuas cov npe tuaj yeem khaws txhua yam khoom uas lawv muaj nyob rau hauv qhov sib txawv thiab tsis cuam tshuam qhov chaw cia.

Tom qab ntawd, lo lus nug yog, dab tsi yog vector C ++? Vectors hauv C++ yog cov ntim khoom sib txuas uas sawv cev rau cov arrays uas tuaj yeem hloov qhov loj. Lawv siv cov chaw khaws cia sib txuas rau lawv cov ntsiab lus, uas txhais tau hais tias lawv cov ntsiab lus tseem tuaj yeem nkag mus siv offsets ntawm cov taw qhia tsis tu ncua rau nws cov ntsiab lus, thiab zoo li hauv cov arrays.

Tsis tas li ntawd, cov npe STL yog dab tsi?

Sau npe hauv C++ Standard Template Library ( STL ) Cov npe yog cov thawv ntim khoom sib txuas uas tso cai rau kev faib cov cim xeeb tsis sib txuas. Raws li piv rau vector, lis muaj qeeb traversal, tab sis ib zaug ib txoj hauj lwm tau pom, insertion thiab deletion yog ceev. Nquag, thaum peb hais a Sau npe , peb tham txog ob npaug txuas lis.

Dab tsi yog khub hauv C ++?

Teeb ntawm khub hauv C++ Ua khub yog ib lub thawv yooj yim uas txhais hauv header uas muaj ob lub ntsiab lus lossis cov khoom. Ua khub yog siv los ua ke ua ke ob qhov tseem ceeb uas tej zaum yuav txawv ntawm hom. Ua khub muab ib txoj hauv kev khaws ob yam khoom sib txawv raws li ib chav tsev. Ua khub tuaj yeem muab, theej thiab muab piv.

Pom zoo: