Tamsayı
türleri :
-----------------
signed
char - 1 byte
unsigned
char - 1 byte
signed
short short>=char
unsigned
short short>=char
signed
int int>=short
unsigned
int int>=short
signed
long long>=int
unsigned
long long>=int
2
Tamsayı sabiti int, unsigned int, long, unsigned long türlerinden
ilk
uygun tür olacak şekilde belleğe yerleştirilir.
Literal
Characters :
---------------------
2U
Tamsayı sabiti unsigned int, unsigned long türlerinden
ilk
uygun tür olacak şekilde belleğe yerleştirilir.
2L
Tamsayı sabiti long, unsigned logn türlerinden
ilk
uygun tür olacak şekilde belleğe yerleştirilir
2UL
unsigned long
Gerçek
sayı türleri (IEEE 754)
-------------------
float
double
long
double
2.3 double
2.3F float
2.3L long
double
2F float
2. double
2.0 double
*/
foo(12.3F);
printf("%d\n",
d);
/*
Otomatik
Sayı dönüşümleri (imlicit type convert)
-------------------------------------------
1.
int'e yükseltme
---------------------
a.
char , short türleri önce int türüne yükseltilir.
b.
short<int ise signed int
c.
sizeof(signed short) == sizeof(signed int) signed int
d.
sizeof(unsigned short) == sizeof(unsigned int) unsigned int
----------------------------------------
2.
long double <işlem> <!long double> = long double
3.
<double> <işlem> <!double> = double
4.
float <işlem> <tamsayı> = float
5.
unsigned long <işlem> <!unsigned long & tamsayı> =
unsigned long
6.
signed long <işlem> <tamsayı & !long> = signed long
7.
unsigned int <işlem> signed int = unsigned int
İstisna1
: sizeof(short) == sizeof(int)
<signed
short> <işlem> <signed int> = unsigned int
İstisna2
: sizeof(int) == sizeof(long)
<signed
int> <işlem> <signed long> = unsigned long
*/
char
ch = -1;
if
(ch > 100000U)
printf("Doğru\n");
else
printf("Yanlış\n");
int
x1 = -23;
unsigned
int y = 2;
printf("x1
= %u\n", x1);
printf("%lf",(float)(x1*y));
func();
extern
int g;
g
= 13;
return
0;
}
Hiç yorum yok:
Yorum Gönder