Microsoft Visual C++/cli step by Step


  Build the application. 4



Download 2,23 Mb.
Pdf ko'rish
bet63/102
Sana31.12.2021
Hajmi2,23 Mb.
#228061
1   ...   59   60   61   62   63   64   65   66   ...   102
Bog'liq
Visual studio C step by step

3. 

Build the application.



4. 

Run the application several times, typing a different month each time. Verify that the applica-

tion displays the correct month name each time.

Using fall-through in a switch statement

If you omit the break statement at the end of a case branch, flow of control continues on to the next 

statement. This process is called fall-through. This can be useful to avoid duplication of code, but be 

careful not to do it accidentally.

The following example illustrates why fall-through might be useful. This example tests a lowercase 

letter to see if it is a vowel or a consonant:

char lowercaseLetter;   // Single lowercase letter, for example 'a' 

...  


switch (lowercaseLetter) 

    case 'a': 



    case 'e': 

    case 'i': 

    case 'o': 

    case 'u':  Console::Write("Vowel"); break; 

 

    default:   Console::Write("Consonant"); break; 



}

There is no break statement in the first four case labels. As a result, the flow of control passes on 

to the next executable statement to display the message Vowel. The default branch deals with all the 

other letters and displays the message Consonant.





Download 2,23 Mb.

Do'stlaringiz bilan baham:
1   ...   59   60   61   62   63   64   65   66   ...   102




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