Microsoft Visual C++/cli step by Step


   Microsoft Visual C++/CLI Step by Step



Download 2,23 Mb.
Pdf ko'rish
bet52/102
Sana31.12.2021
Hajmi2,23 Mb.
#228061
1   ...   48   49   50   51   52   53   54   55   ...   102
Bog'liq
Visual studio C step by step

58  

Microsoft Visual C++/CLI Step by Step

Note  There is no semicolon after the closing parenthesis in the if test. It is a common C++ 

programming error to put one in by mistake, as shown here:

if (number < 0);   // Note the spurious semicolon

This statement is equivalent to the following statement, which is probably not what you 

intended:

if (number < 0) 

    ;   // Null if-body – do nothing if number < 0

If you want to include more than one statement in the if body, enclose the if body in braces 

({}), as follows:

if (number < 0) 

    Console::Write("The number "); 



    Console::Write(number); 

    Console::WriteLine(" is negative"); 

Console::WriteLine("The end");



Many developers reckon that it is good practice to enclose the if body in braces, even if it 

only consists of a single statement. This means that the code will still be correct if you (or 

another developer) add more statements to the if body in the future.

In this exercise, you will create a new application to perform one-way tests. As this chapter pro-

gresses, you will extend the application to use more complex decision-making constructs and to 

perform loops. For now, the application asks the user to enter a date and then it performs simple 

validation and displays the date in a user-friendly format on the console.


Download 2,23 Mb.

Do'stlaringiz bilan baham:
1   ...   48   49   50   51   52   53   54   55   ...   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