Macro | Value | Description |
---|---|---|
CHAR_BIT | 8 | Defines the number of bits in a byte. |
SCHAR_MIN | -128 | Defines the minimum value for a signed char. |
SCHAR_MAX | +127 | Defines the maximum value for a signed char. |
UCHAR_MAX | 255 | Defines the maximum value for an unsigned char. |
CHAR_MIN | -128 | Defines the minimum value for type char and its value will be equal to SCHAR_MIN if char represents negative values, otherwise zero. |
CHAR_MAX | +127 | Defines the value for type char and its value will be equal to SCHAR_MAX if char represents negative values, otherwise UCHAR_MAX. |
MB_LEN_MAX | 16 | Defines the maximum number of bytes in a multi-byte character. |
SHRT_MIN | -32768 | Defines the minimum value for a short int. |
SHRT_MAX | +32767 | Defines the maximum value for a short int. |
USHRT_MAX | 65535 | Defines the maximum value for an unsigned short int. |
INT_MIN | -2147483648 | Defines the minimum value for an int. |
INT_MAX | +2147483647 | Defines the maximum value for an int. |
UINT_MAX | 4294967295 | Defines the maximum value for an unsigned int. |
LONG_MIN | -9223372036854775808 | Defines the minimum value for a long int. |
LONG_MAX | +9223372036854775807 | Defines the maximum value for a long int. |
ULONG_MAX | 18446744073709551615 | Defines the maximum value for an unsigned long int. |
<stdint.h>
header file, which provides names and limits for explicitly-sized platform-independent integer datatypes (e.g. int32_t
for a 32-bit signed integer)._MIN
values represent the minimum magnitude representable in the rarely-used one's complement and sign-magnitude forms. Most implementations will have larger magnitudes for at least some of these numbers. For instance:SCHAR_MIN
equal to −128 (and similarly for all other _MIN
values).INT_MAX
equal to +2,147,483,647 (and likewise for INT_MIN
and UINT_MAX
)MB_LEN_MAX
to 4 or more.CHAR_BIT
equal to 16 or more[1][2].Name | Description | Typical value | ANSI standard minimum- or maximum magnitude value | |
---|---|---|---|---|
CHAR_BIT | Number of bits in a char | 8 | ≥+8 | |
SCHAR_MIN | Minimum value for a signed char | −128 | ≤−127 | |
SCHAR_MAX | Maximum value for a signed char | +127 | ≥+127 | |
UCHAR_MAX | Maximum value for an unsigned char | +255 | ≥+255 | |
CHAR_MIN | Minimum value for a char | −128 | ≤−127 (if char is represented as asigned char ; otherwise ≤0) | |
CHAR_MAX | Maximum value for a char | +127 | ≥+127 (if char is represented as asigned char ; otherwise ≥+255) | |
MB_LEN_MAX | Maximum multi byte length of a character across all locales | varies, usually at least 4 | ≥+1 | |
SHRT_MIN | Minimum value for a short int | −32,768 | ≤−32,767 | |
SHRT_MAX | Maximum value for a short int | +32,767 | ≥+32,767 | |
USHRT_MAX | Maximum value for an unsigned short int | +65,535 | ≥+65,535 | |
INT_MIN | Minimum value for an int | −2,147,483,648 | ≤−32,767 | |
INT_MAX | Maximum value for an int | +2,147,483,647 | ≥+32,767 | |
UINT_MAX | Maximum value for an unsigned int | +4,294,967,295 | ≥+65,535 | |
LONG_MIN | Minimum value for a long int | 32 bit compiler | −2,147,483,648 | ≤−2,147,483,647 |
64 bit compiler | −9,223,372,036,854,775,808 | |||
LONG_MAX | Maximum value for a long int | 32 bit compiler | +2,147,483,647 | ≥+2,147,483,647 |
64 bit compiler | +9,223,372,036,854,775,807 | |||
ULONG_MAX | Maximum value for an unsigned long int | 32 bit compiler | +4,294,967,295 | ≥+4,294,967,295 |
64 bit compiler | +18,446,744,073,709,551,615 | |||
LLONG_MIN | Minimum value for a long long int | −9,223,372,036,854,775,808 | ≤−9,223,372,036,854,775,807 | |
LLONG_MAX | Maximum value for a long long int | +9,223,372,036,854,775,807 | ≥+9,223,372,036,854,775,807 | |
ULLONG_MAX | Maximum value for an unsigned long long int | +18,446,744,073,709,551,615 | ≥+18,446,744,073,709,551,615 |