C# 0 The Complete Reference


PART I C h a p t e r   1 4



Download 4,07 Mb.
Pdf ko'rish
bet480/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   476   477   478   479   480   481   482   483   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt


PART I

C h a p t e r   1 4 :  

U s i n g   I / O  

371


PART IPART I

As the output confirms, each time a key is pressed, 



ReadKey( )

 immediately returns the 

keypress. As explained, this differs from 

Read( )

 and 


ReadLine( )

, which use line-buffered 

input. Therefore, if you want to achieve interactive responses from the keyboard, use 

ReadKey( )

.

Writing Console Output



Console.Out

 and 


Console.Error

 are objects of type 



TextWriter

. Console output is most easily 

accomplished with 

Write( )

 and 


WriteLine( )

, with which you are already familiar. Versions 

of these methods exist that output for each of the built-in types. 

Console

 defines its own 

versions of 

Write( )

 and 


WriteLine( )

 so they can be called directly on 



Console

, as you have 

been doing throughout this book. However, you can invoke these (and other) methods on 

the


TextWriter

 that underlies 



Console.Out

 and 


Console.Error

 if you choose.

Here is a program that demonstrates writing to 


Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   476   477   478   479   480   481   482   483   ...   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