DEV Community

Cover image for O'ZGARUVCHILAR VA MA'LUMOT TURLARI
madina1575
madina1575

Posted on • Edited on

O'ZGARUVCHILAR VA MA'LUMOT TURLARI

Salom!!!
Bugun o'zgaruvchilar va ma'lumot turlari, ular bir - birisiz tushunish qiyin bo'lgani uchun ma'lumotlarni zanjir uslubida qabul qilasiz degan umiddaman!

O'zgaruvchi

  • kompyuter xotirasida ma'lum bir qiymatni saqlash uchun ishlatiladi.

Ma'lumot turlari

  • o'zgaruvchi oldidan yoziladi va o'zgaruvchilarning qanday turiga tegishli ekanligini anglatadi.

Mavzularni davom etishdan oldin bu terminlarni tushunmaydigan do'stlarimizga ham biroz tushuncha bersak:

O'zgaruvchini biror bir quti deb tasavvur qilsak, uning ichiga nima sig'ishini, nima solish mumkinligini uning hajmidan, ko'rinishidan bilsak bo'ladi. Aynan ko'rinishi va hajmini haqiqiy hayotda ko'zimiz bilan aniqlasak, c++ dasturlash tilida biz ma'lumot turlaridan bilsak bo'ladi! Ha, aytgancha o'zgaruvchilar nega aynan qutiga o'xshaydi desangiz quti ichiga ham biror bir narsangizni solib, saqlab qo'ya olasiz, xoh u ruchkadek kichik bo'lsin, xoh kitobdek qalin!

Image description

Endi ma'lumot turlarining xilma - hilligini ko'rib chiqamiz:

1 - chisi aynan butun sonlar uchun ishlatiladi hotiradan oladigan hajmiga ko'ra 4 xil bo'ladi:
1.integer => int deb yoziladi. => 4 byte => 32 bit
2.long. => 8 byte => 64 bit
3.long int. => 8 byte => 64 bit
4.long long. => 16 byte => 128 bit

2 - chisi esa kasr sonlar uchun ishlatiladi:
1.float => 4 byte => 32 bit
2.double => 8 byte => 64 bit
3.long double =>

3 - chisi bo'lsa tekst va matnlar uchun ishlatiladi:
1.string => 32 byte => 256 bit

4 - chisi belgilar uchun ishlatiladi:
1.char => 1 byte => 8 bit

O'zgaruvchilar va ma'lumot turlari bir-biriga bog'liqligi ularning birga e'lon qilinishiga bog'liq.

Image description

O'zgaruvchilarni e'lon qilish ingliz tilida - DECLARATION deb aytiladi.

int son;
float kasrson;
string ism;
char belgi;
Enter fullscreen mode Exit fullscreen mode

Mavzu boshida aytganimizday o'zgaruvchilarga qiymat berish, saqlash mumkin. Uning 2 xil usuli bor:

1-chisi. O'zgaruvchini e'lon qilib pastgi qatordan qiymat berish mumkin.

int son;
son = 10;
string ism;
ism = "Sarvar";
Enter fullscreen mode Exit fullscreen mode

2-chisi. O'zgaruvchi e'lon qilingan qatorda qiymat berilishi.Bu holat ingliz tilida INITIALIZATION deb aytiladi.

float kasrson = 1.4;
char belgi = '+';
Enter fullscreen mode Exit fullscreen mode

Agar biror bir kamchilik bo'lsa o'zingiz to'ldiring!

Billboard image

Imagine monitoring that's actually built for developers

Join Vercel, CrowdStrike, and thousands of other teams that trust Checkly to streamline monitor creation and configuration with Monitoring as Code.

Start Monitoring

Top comments (1)

Collapse
 
islomali99 profile image
islomAli99

Cool

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay