C# 0 The Complete Reference


count  within the block of the outer  for



Download 4,07 Mb.
Pdf ko'rish
bet110/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   106   107   108   109   110   111   112   113   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

count

 within the block of the outer 



for

 loop is completely valid. However, in C/C++, such 

a declaration hides the outer variable. The designers of C# felt that this type of 

name hiding

could easily lead to programming errors and disallowed it.

www.freepdf-books.com



PART I

C h a p t e r   3 :  

D a t a   T y p e s ,   L i t e r a l s ,   a n d   V a r i a b l e s  

55

PART IPART I



Type Conversion and Casting

In programming, it is common to assign one type of variable to another. For example, you 

might want to assign an 

int

 value to a 



float

 variable, as shown here:

int i;

float f;


i = 10;

f = i; // assign an int to a float

When compatible types are mixed in an assignment, the value of the right side is 

automatically converted to the type of the left side. Thus, in the preceding fragment, the 

value in 


Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   106   107   108   109   110   111   112   113   ...   1096




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish