5.2.4.2.1 Sizes of integer types <limits.h>
The values given below shall be replaced by constant expressions suitable for use in #if preprocessing directives. Moreover, except for CHAR_BIT and MB_LEN_MAX, the following shall be replaced by expressions that have the same type as would an expression that is an object of the corresponding type converted according to the integer promotions. Their implementation-defined values shall be equal or greater in magnitude (absolute value) to those shown, with the same sign.
Identifier |
Value |
Comment |
|---|---|---|
number of bits for smallest object that is not a bit-field (byte) |
||
CHAR_BIT |
8 |
|
minimum value for an object of type signed char |
||
SCHAR_MIN |
||
maximum value for an object of type signed char |
||
SCHAR_MAX |
||
maximum value for an object of type unsigned char |
||
UCHAR_MAX |
||
minimum value for an object of type char |
||
CHAR_MIN |
see below |
|
maximum value for an object of type char |
||
CHAR_MAX |
see below |
|
maximum number of bytes in a multibyte character, for any supported locale |
||
MB_LEN_MAX |
1 |
|
minimum value for an object of type short int |
||
SHRT_MIN |
||
maximum value for an object of type short int |
||
SHRT_MAX |
||
maximum value for an object of type unsigned short int |
||
USHRT_MAX |
||
minimum value for an object of type int |
||
INT_MIN |
||
maximum value for an object of type int |
||
INT_MAX |
||
maximum value for an object of type unsigned int |
||
UINT_MAX |
||
minimum value for an object of type long int |
||
LONG_MIN |
||
maximum value for an object of type long int |
||
LONG_MAX |
||
maximum value for an object of type unsigned long int |
||
ULONG_MAX |
||
minimum value for an object of type long long int |
||
LLONG_MIN |
||
maximum value for an object of type long long int |
||
LLONG_MAX |
||
maximum value for an object of type unsigned long long int |
||
ULLONG_MAX |
||
If the value of an object of type char is treated as a signed integer when used in an expression, the value of CHAR_MIN shall be the same as that of SCHAR_MIN and the value of CHAR_MAX shall be the same as that of SCHAR_MAX. Otherwise, the value of CHAR_MIN shall be 0 and the value of CHAR_MAX shall be the same as that of UCHAR_MAX.[1] The value UCHAR_MAX shall equal 2CHAR_BIT - 1.
Forward References
Footnotes