Nws txhais li cas kom ntaus zog?
Nws txhais li cas kom ntaus zog?

Video: Nws txhais li cas kom ntaus zog?

Video: Nws txhais li cas kom ntaus zog?
Video: Npau Suav li no Txhob coj mus tham qhia luag lwm tus 2024, Kaum ib hlis
Anonim

A muaj zog - ntaus ntawv programming lus yog ib qho uas txhua hom ntaub ntawv (xws li tus lej, cim, hexadecimal, packed decimal, thiab lwm yam) yog ua ntej raws li ib feem ntawm cov lus programming thiab tag nrho cov tsis tu ncua los yog hloov pauv rau ib qho kev pab cuam yuav tsum tau piav qhia nrog ib qho ntawm cov ntaub ntawv hom.

Raws li txoj cai, nws txhais li cas rau ib hom lus kom ntaus statically ntaus yam uas tiv thaiv tsis txhob hais C los ntawm kev ntaus ntawv?

Statically ntaus ntawv : cov lus yog tias nws ua hom kev kuaj xyuas ntawm lub sijhawm sib sau ua ke tsis yog lub sijhawm ua haujlwm. Hauv statically ntaus hom lus , qhov yuam kev yuav muab pov rau ntawm lub sijhawm sau tsis yog lub sijhawm khiav. Vim li no, C tiv thaiv los ntawm raug ntaus heev . Lub npe ob qho tseem ceeb programming yam lus uas muaj zog tab sis dynamically. ntaus ntawv.

Tsis tas li ntawd, C ++ puas ntaus ntawv? C++ yog ntau ntaus ntawv heev tshaj C vim tias nws muaj parametric polymorphism (los ntawm cov qauv), cia koj tsim cov ntaub ntawv dav dav uas tseem raug. ntaus ntawv . Python tsis zoo li ntaus ntawv heev raws li C++ vim nws tsis tuaj yeem sawv cev zoo li no. C++ tej zaum yuav muaj qhov khoob, tab sis Python hom system tseem tsis muaj zog.

Qhov thib ob, ntaus ntawv txhais tau li cas C #?

Teb rau lub Yim Hli 10, 2016. Thaum peb hais ib yam dab tsi yog ntaus ntawv peb txhais tau tias tias cov hom ntawm qhov khoom yog paub thiab muaj los siv. Peb tuaj yeem hais C# ua zog ntaus ntawv , piv txwv li koj ua tsis tau ua ib qho kev ua haujlwm airthmatic ntawm ob qhov sib txawv hom ntawm qhov sib txawv (xws li String vs Integer).

Dab tsi yog qhov sib txawv ntawm qhov sib zog ntaus thiab ntaus tsis muaj zog?

Lub ntsiab txawv , roughly hais lus, nruab nrab a ntaus ntawv heev lus thiab a tsis muaj zog ntaus ntawv ib ni a tsis muaj zog ntaus ntawv ib tug ua kev hloov dua siab tshiab nruab nrab yam tsis muaj kev cuam tshuam implicitly, thaum a ntaus ntawv heev ib qho feem ntau tsis tso cai rau kev hloov pauv tsis raug nruab nrab yam tsis sib xws.

Pom zoo: