C# 0 The Complete Reference


PART I C h a p t e r   4



Download 4,07 Mb.
Pdf ko'rish
bet123/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   119   120   121   122   123   124   125   126   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt


PART I

C h a p t e r   4 :  

O p e r a t o r s  

65

PART IPART I



Understand, however, that in the increment or decrement forms, 

x

 is evaluated only once, 

not twice. This can improve efficiency in some cases.

Both the increment and decrement operators can either precede (prefix) or follow 

(postfix) the operand. For example

x = x + 1;

can be written as

++x; // prefix form

or as

x++; // postfix form



In the foregoing example, there is no difference whether the increment is applied as a 

prefix or a postfix. However, when an increment or decrement is used as part of a larger 

expression, there is an important difference. When an increment or decrement operator 

precedes

 its operand, the result of the operation is the value of the operand 



after

 the increment. 

If the operator 

follows

 its operand, the result of the operation is the value of the operand 



before

 the increment. Consider the following:

x = 10;

y = ++x;


In this case, 


Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   119   120   121   122   123   124   125   126   ...   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