Cov txheej txheem:

Dab tsi yog hom lej hauv C #?
Dab tsi yog hom lej hauv C #?

Video: Dab tsi yog hom lej hauv C #?

Video: Dab tsi yog hom lej hauv C #?
Video: Tus Tseem Poj Laib Ces Yog Kuv | Npauj Nyiag Yaj | Ma Ya | Official MV 2023 2024, Kaum ib hlis
Anonim

Ntau hom

Hom Cia qhov loj Tus nqi ntau
kos npe char 1 byte ib -128-127: kuv
int 2o4 ib -32, 768 txog 32, 767 lossis -2, 147, 483, 648 txog 2, 147, 483, 647
unsigned ua 2o4 ib 0 mus rau 65, 535 los yog 0 rau 4, 294, 967, 295
luv 2 bytes -32, 768 to 32, 767 ib

Tsis tas li, cov ntaub ntawv sib txawv hauv C# yog dab tsi?

C# feem ntau categorized hom ntaub ntawv hauv ob hom : Tus nqi hom thiab siv hom . Tus nqi hom suav nrog yooj yim hom (e.g. int, float, bool, and char), enum hom ,struct hom , thiab Nullable tus nqi hom . Kev siv hom suav nrog chav kawm hom , interface hom , delegate hom , thiab array hom.

Tsis tas li ntawd, ntev npaum li cas tus int hauv C? Qhov loj ntawm int feem ntau yog 4 bytes (32 ntsis). Thiab, nws tuaj yeem siv 232 Cov xeev txawv ntawm -2147483648 txog 2147483647.

Tom qab ntawd, cov ntaub ntawv sib txawv yog dab tsi?

Hom ntaub ntawv uas muaj xws li:

  • Tus lej.
  • Floating point tooj.
  • Cim.
  • Txoj hlua.
  • Boolean.

Tus nqi integer hauv C yog dab tsi?

Tus lej hauv C = tag nrho cov naj npawb nrog ntau yam. Tus lej tuaj yeem tsuas yog qhov zoo (tsis tau kos npe) lossis ob qho tib si zoo thiab tsis zoo (kos npe). Nws tuaj yeem yog 8 ntsis (char), 16 ntsis (luv) lossis 32 ntsis (ntev). Qhov siab tshaj plaws tus nqi ntawm UNSIGNED CHAR = 255. Qhov tsawg kawg nkaus tus nqi ntawm SHORT INT = -32768.

Pom zoo: