Friday, March 19, 2010

Data Types in C Language

common definitions of integral types
Implicit specifier(s) Explicit specifier Number of bits Unambiguous type
signed char same 8 int8_t
unsigned char same 8 uint8_t
char one of the above 8 int8_t or uint8_t
short signed short int 16 int16_t
unsigned short unsigned short int 16 uint16_t
int signed int 16 or 32 int16_t or int32_t
unsigned unsigned int 16 or 32 uint16_t or uint32_t
long signed long int 32 or 64 int32_t or int64_t
unsigned long unsigned long int 32 or 64 uint32_t or uint64_t
long long[1] signed long long int 64 int64_t
unsigned long long[1] unsigned long long int 64 uint64_t
 

 

 
Specific integral type limits
Specifier Common Equivalent Signing Bits Bytes Minimum Value Maximum Value
int8_t signed char Signed 8 1 −128 127
uint8_t unsigned char Unsigned 8 1 0 255
int16_t short Signed 16 2 −32,768 32,767
uint16_t unsigned short Unsigned 16 2 0 65,535
int32_t int Signed 32 4 −2,147,483,648 2,147,483,647
uint32_t unsigned int Unsigned 32 4 0 4,294,967,295
int64_t long long Signed 64 8 −9,223,372,036,854,775,808 9,223,372,036,854,775,807
uint64_t unsigned long long Unsigned 64 8 0 18,446,744,073,709,551,615        

No comments:

Post a Comment