C# 0 The Complete Reference


Creating Fixed-Size Buffers



Download 4,07 Mb.
Pdf ko'rish
bet752/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   748   749   750   751   752   753   754   755   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

Creating Fixed-Size Buffers

There is a second use of the 



fixed

 keyword that enables you to create fixed-sized, single-

dimensional arrays. In the C# documentation, these are referred to as 

fixed-size buffers.

 A fixed-

size buffer is always a member of a 

struct

. The purpose of a fixed-size buffer is to allow the 

creation of a 

struct

 in which the array elements that make up the buffer are contained within 

the

struct

. Normally, when you include an array member in a 



struct

, only a reference to the 

array is actually held within the 

struct

. By using a fixed-size buffer, you cause the entire array 

to be contained within the 

struct

. This results in a structure that can be used in situations in 

which the size of a 

struct

 is important, such as in mixed-language programming, interfacing 

to data not created by a C# program, or whenever a nonmanaged 

struct

 containing an array is 

required. Fixed-size buffers can be used only within an unsafe context.

www.freepdf-books.com




Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   748   749   750   751   752   753   754   755   ...   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