C examples for Data Type:Introduction
Type | Typical Size in Bits | Minimal Range |
---|---|---|
char | 8 | -127 to 127 |
unsigned char | 8 | 0 to 255 |
signed char | 8 | -127 to 127 |
int | 16 or 32 | -32,767 to 32,767 |
unsigned int | 16 or 32 | 0 to 65,535 |
signed int | 16 or 32 | -32,767 to 32,767 |
short int | 16 | -32,767 to 32,767 |
unsigned short int | 16 | 0 to 65,535 |
signed short int | 16 | -32,767 to 32,767 |
long int | 32 | -2,147,483,647 to 2,147,483,647 |
long long int | 64 | -(2^63 - 1) to 2^63 - 1 (Added by C99) |
signed long int | 32 | -2,147,483,647 to 2,147,483,647 |
unsigned long int | 32 | 0 to 4,294,967,295 |
unsigned long long int | 64 | 2^64 - 1 (Added by C99) |
float | 32 | 1E-37 to 1E+37 with six digits of precision |
double | 64 | 1E-37 to 1E+37 with ten digits of precision |
long double | 80 | 1E-37 to 1E+37 with ten digits of precision |
The following sets of type specifiers are equivalent:
Specifier | Same As |
---|---|
signed | signed int |
unsigned | unsigned int |
long | long int |
short | short int |