Objected-oriented Programming 2 Introduction


Using constant with Pointers



Download 377,78 Kb.
bet4/5
Sana01.02.2022
Hajmi377,78 Kb.
#422225
1   2   3   4   5
Bog'liq
Week-1

Using constant with Pointers

  • const qualifier
    • Indicates that value of variable should not be modified
    • const used when function does not need to change the variable’s value
    • Example
      • A function that prints the elements of an array, takes array and int indicating length
        • Array contents are not changed – should be const
        • Array length is not changed – should be const
  • Four ways to pass pointer to function
    • Non-constant pointer to non-constant data
    • Non-constant pointer to constant data//we cannot set
    • Constant pointer to non-constant data
    • Constant pointer to constant data//A const pointer to a const value can not be set to point to another address, nor can the value it is pointing to be changed through the pointer.

Download 377,78 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5




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