climits (limits.h)


header

Sizes of integral types

This header defines constants with the limits of integral types for the specific system and compiler implemetation used.

The following panel shows the different constants and their guaranteed minimal magnitudes (positive numbers may be greater in value, and negative numbers may be less in value). Any particular compiler implementation may define integral types with greater magnitudes than those shown here:

nameexpressesmin. magnitude*
CHAR_BITNumber of bits for a char object (byte)8
SCHAR_MINMinimum value for an object of type signed char-127
SCHAR_MAXMaximum value for an object of type signed char127
UCHAR_MAXMaximum value for an object of type unsigned char255
CHAR_MINMinimum value for an object of type chareither SCHAR_MIN or 0
CHAR_MAXMaximum value for an object of type chareither SCHAR_MAX or UCHAR_MAX
MB_LEN_MAXMaximum number of bytes in a multibyte character, for any locale1
SHRT_MINMinimum value for an object of type short int-32767
SHRT_MAXMaximum value for an object of type short int32767
USHRT_MAXMaximum value for an object of type unsigned short int65535
INT_MINMinimum value for an object of type int-32767
INT_MAXMaximum value for an object of type int32767
UINT_MAXMaximum value for an object of type unsigned int65535
LONG_MINMinimum value for an object of type long int-2147483647
LONG_MAXMaximum value for an object of type long int2147483647
ULONG_MAXMaximum value for an object of type unsigned long int4294967295


* This is not necessarily the actual value of the constant in any particular compiler or system, it may be equal or greater in magnitude than this.

See also