Page 132 - C-Language
P. 132
constants start just with a 0. The latter two are signed or unsigned depending on whether the value
fits into the signed type or not.
/* suffixes to describe width and signedness : */
long int i = 0x32; /* no suffix represent int, or long int */
unsigned int ui = 65535u; /* u or U represent unsigned int, or long int */
long int li = 65536l; /* l or L represent long int */
Without a suffix the constant has the first type that fits its value, that is a decimal constant that is
larger than INT_MAX is of type long if possible, or long long otherwise.
The header file <limits.h> describes the limits of integers as follows. Their implementation-defined
values shall be equal or greater in magnitude (absolute value) to those shown below, with the
same sign.
Macro Type Value
CHAR_BIT smallest object that is not a bit-field (byte) 8
7
SCHAR_MIN signed char -127 / -(2 - 1)
7
SCHAR_MAX signed char +127 / 2 - 1
8
UCHAR_MAX unsigned char 255 / 2 - 1
CHAR_MIN char see below
CHAR_MAX char see below
15
SHRT_MIN short int -32767 / -(2 - 1)
15
SHRT_MAX short int +32767 / 2 - 1
16
USHRT_MAX unsigned short int 65535 / 2 - 1
15
INT_MIN int -32767 / -(2 - 1)
15
INT_MAX int +32767 / 2 - 1
16
UINT_MAX unsigned int 65535 / 2 - 1
31
LONG_MIN long int -2147483647 / -(2 - 1)
31
LONG_MAX long int +2147483647 / 2 - 1
32
ULONG_MAX unsigned long int 4294967295 / 2 - 1
C99
Macro Type Value
63
LLONG_MIN long long int -9223372036854775807 / -(2 - 1)
https://riptutorial.com/ 108

