The limits (constant names, meanings, and values) for integral types are defined in the standard include file LIMITS.H. They are shown in Table 2.6.
Table 2.6 Limits for Integral Types
Constant | Meaning | Value |
CHAR_BIT | Number of bits in the smallest variable that is not a bit field. | 8 | |
SCHAR_MIN | Minimum value for a variable of type signed char., –127 | ||
SCHAR_MAX | Maximum value for a variable of type signed char., 127 | ||
UCHAR_MAX | Maximum value for a variable of type unsigned char. | 255 (0xff) | |
CHAR_MIN | Minimum value for a variable of type char., Same as –127; 0 if /J option used. | ||
CHAR_MAX | Maximum value for a variable of type char., Same as 127; 255 if /J option used. | ||
MB_LEN_MAX | Maximum number of bytes in a multicharacter constant., 2 | ||
SHRT_MIN | Minimum value for a variable of type short., –32767 | ||
SHRT_MAX | Maximum value for a variable of type short., 32767 | ||
USHRT_MAX | Maximum value for a variable of type unsigned short. | 65535 (0xffff) | |
INT_MIN | Minimum value for a variable of type int1., –32767 | ||
INT_MAX | Maximum value for a variable of type int2., 32767 | ||
UINT_MAX | Maximum value for a variable of type unsigned int3., 65535 (0xffff) | ||
LONG_MIN | Minimum value for a variable of type long., –2147483647 | ||
LONG_MAX | Maximum value for a variable of type long., 2147483647 | ||
ULONG_MAX | Maximum value for a variable of type unsigned long. | 4294967295 (0xffffffff) |
1The value for INT_MIN is –2147483648 for 32-bit target compilations
2The value for INT_MAX is 2147483647 for 32-bit target compilations
3The value for UINT_MAX is 4294967295 (0xffffffff) for 32-bit target compilations