C nyelv adattípusai
Egész típusok
Adat típus | # bytes | # bits | Minimum érték | Maximum érték | printf() |
char | 1 | 8 | -128 | 127 | %d |
signed char | 1 | 8 | -128 | 127 | %d |
unsigned char | 1 | 8 | 0 | 255 | %u |
short | 2 | 16 | -32768 | 32767 | %d |
signed short | 2 | 16 | -32768 | 32767 | %d |
unsigned short | 2 | 16 | 0 | 65535 | %u |
int | 4 | 32 | -2147483648 | 2147483647 | %d |
signed int | 4 | 32 | -2147483648 | 2147483647 | %d |
unsigned int | 4 | 32 | 0 | 4294967295 | %u |
long | 4 | 32 | -2147483648 | 2147483647 | %ld |
signed long | 4 | 32 | -2147483648 | 2147483647 | %ld |
unsigned long | 4 | 32 | 0 | 4294967295 | %lu |
long long | 8 | 64 | -9223372036854775808 | 9223372036854775807 | %lld |
signed long long | 8 | 64 | -9223372036854775808 | 9223372036854775807 | %lld |
unsigned long long | 8 | 64 | 0 | 18446744073709551615 | %llu |
Lebegőpontos / floating point típusok
Adat typus | # bytes | Minimum érték | Maximum érték | Pontosság | printf() |
float | 4 | 1.2E-38 | 3.4E+38 | 6 tizedes jegy | %f, %e |
double | 8 | 2.3E-308 | 1.7E+308 | 15 tizedes jegy | %lf, %le |
long double | 10 | 3.4E-4932 | 1.1E+4932 | 19 tizedes jegy | %Lf, %Le |
Összefoglalás