C# 0 The Complete Reference



Download 4,07 Mb.
Pdf ko'rish
bet202/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   198   199   200   201   202   203   204   205   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

One-Dimensional Arrays

A

one-dimensional array

 is a list of related variables. Such lists are common in programming. 

For example, you might use a one-dimensional array to store the account numbers of the 

active users on a network. Another array might store the current batting averages for a 

baseball team.

Because arrays in C# are implemented as objects, two steps are needed to obtain an 

array for use in your program. First, you must declare a variable that can refer to an array. 

Second, you must create an instance of the array by use of 

new

. Therefore, to declare a one-

dimensional array, you will typically use this general form:

type

[ ]


 array-name

 = new 


type

[

size

];

137


CHAPTER

www.freepdf-books.com




138

 

P a r t   I :  



T h e   C #   L a n g u a g e

Here, 


type

 declares the 



element type

 of the array. The element type determines the data type 

of each element that comprises the array. Notice the square brackets that follow 

type.

 They 


indicate that a one-dimensional array is being declared. The number of elements that the 

array will hold is determined by 



size.


Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   198   199   200   201   202   203   204   205   ...   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