26.07.2017 Views

bilgeadam-c-kitabi

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

20 KISIM I:<br />

Veri Tipleri<br />

Veri Tipleri<br />

• Boolean<br />

• Byte<br />

• Char<br />

• Date<br />

• Decimal<br />

• Double<br />

• Int16 - Short<br />

• Int32 - Integer<br />

• Int64 – Long<br />

• Single<br />

• String<br />

String yazi = "Veri tipleri örnekleri“;<br />

boolean bool = True;<br />

char karakter = "A“;<br />

date tarih = #4/23/2005#;<br />

decimal numerik = -123456789;<br />

double cift = -1.234E-120;<br />

single tek = 3.32E+100;<br />

byte bayt = 255;<br />

short kisaSayi = -32000;<br />

int tamSayi = 2000000000;<br />

long uzunSayi = -123456789123456789;<br />

Veri tipi, değişkenlerin tuttukları değerlerin türünü ve bellekte tutulacak<br />

boyutunu tanımlar. Değişkenleri veri tipleri ile tanımlarken verinin boyutuna<br />

göre bir veri tipi seçilmelidir.<br />

Visual C#.NET veri tipleri Tablo 1’de listelenmiştir.<br />

Veri Tipi Boyut Değer<br />

bool 2 Bayt true – false<br />

byte 1 Bayt 0 – 255<br />

char 2 Bayt Tek bir Unicode karakteri tutar<br />

decimal 16 Bayt Maksimum 29 haneli sayı tutar. +/-<br />

79,228,162,514,264,337,593,543,950,335<br />

arasında değer alır<br />

double 8 Bayt Negatif sayı aralığı:<br />

-1.79769E+308 ile -4.94065E-324<br />

Pozitif sayı aralığı:<br />

4.94065E-324 ile 1.79769E+308<br />

Int32 4 Bayt -2,147,483,648 – 2,147,483,647<br />

Int16 2 Bayt 32,768 – 32,767<br />

Int64 8 Bayt -9,223,372,036,854,775,808 –<br />

9,223,372,036,854,775,807.<br />

float 4 Bayt Negatif sayı aralığı:<br />

HERKES İÇİN UNIX<br />

-3.4028235E+38 ile -1.401298E-45<br />

Pozitif sayı aralığı:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!