The <limits.h> header file


  
This header file contains a set of various platform-dependent constants proposed in ANSI C, which allow making more portable programs:


NameValueDefined asMeaning
CHAR_BIT88Length of a char variable in bits
CHAR_MAX127 (255)127 (255)Maximal value which can be stored in a char variable
CHAR_MIN-128 (0)-128 (0)Minimal value which can be stored in a char variable
SCHAR_MAX127127Maximal value which can be stored in a signed char variable
SCHAR_MIN-128-128Minimal value which can be stored in a signed char variable
UCHAR_MAX255255Maximal value which can be stored in an unsigned char variable
SHRT_MAX327670x7FFFMaximal value which can be stored in a short int variable
SHRT_MIN-32768((short)0x8000)Minimal value which can be stored in a short int variable
USHRT_MAX655350xFFFFUMaximal value which can be stored in an unsigned short variable
INT_MAX32767 (2147483647)0x7FFF (0x7FFFFFFF)Maximal value which can be stored in an int variable
INT_MIN-32768 (-2147483648)((int)0x8000) (((int)0x80000000))Minimal value which can be stored in an int variable
UINT_MAX65535 (4294967295)0xFFFFU (0xFFFFFFFFUL)Maximal value which can be stored in an unsigned int variable
LONG_MAX21474836470x7FFFFFFFLMaximal value which can be stored in a long int variable
LONG_MIN-2147483648((long)0x80000000L)Minimal value which can be stored in a long int variable
ULONG_MAX42949672950xFFFFFFFFULMaximal value which can be stored in an unsigned long int variable

NOTE: CHAR_MAX and CHAR_MIN may have different values depending of whether chars are signed or not. They are signed by default in TIGCC, but this may be changed using some compiler command switches. Similarly, INT_MAX, INT_MIN, and UINT_MAX depend on whether short or long integers are used.

Return to the main index