Limits.h

From Wikipedia, the free encyclopedia

C++ Standard Library headers
C Standard Library headers
assert.h
complex.h
ctype.h
errno.h
fenv.h
float.h
inttypes.h
iso646.h
limits.h
locale.h
math.h
setjmp.h
signal.h
stdarg.h
stdbool.h
stddef.h
stdint.h
stdio.h
stdlib.h
string.h
tgmath.h
time.h
wchar.h
wctype.h
The correct title of this article is limits.h. The initial letter is shown capitalized due to technical restrictions.

limits.h is the header of the general purpose standard library of C programming language which includes definitions of the characteristics of variable types. The values are implementation specific, but may not be of lower magnitude than certain specified values in a conforming C implementation.

Contents

[edit] Member constants

Name Description Minimum value*
CHAR_BIT Number of bits in a byte +8
SCHAR_MIN Minimum value for a signed char -127
SCHAR_MAX Maximum value for a signed char +127
UCHAR_MAX Maximum value for an unsigned char +255
CHAR_MIN Minimum value for a char -127 (if char is represented as a signed char; otherwise 0)
CHAR_MAX Minimum value for a char +127 (if char is represented as a signed char; otherwise +255)
MB_LEN_MAX Maximum number of bytes in a multibyte character +1
SHRT_MIN Minimum value for a short int -32,767
SHRT_MAX Maximum value for a short int +32,767
USHRT_MAX Maximum value for an unsigned short int +65,535
INT_MIN Minimum value for an int -32,767
INT_MAX Maximum value for an int +32,767
UINT_MAX Maximum value for an unsigned int +65,535
LONG_MIN Minimum value for a long int -2,147,483,647
LONG_MAX Maximum value for a long int +2,147,483,647
ULONG_MAX Maximum value for an unsigned long int +4,294,967,295
LLONG_MIN Minimum value for a long long int -9,223,372,036,854,775,807
LLONG_MAX Maximum value for a long long int +9,223,372,036,854,775,807
ULLONG_MAX Maximum value for an unsigned long long int +18,446,744,073,709,551,615
  • *Notes on minimum value: The magnitude of this column is the minimum magnitude for this constant. Negative values represent the minimum value representable in one's complement and sign-magnitude forms. Most implementations use a two's complement representation, in which case the minimum value will be one less (for example, INT_MAX may be +32767 while INT_MIN is -32768).

[edit] See also

C standard library

[edit] External Links

  • Enquire: A program for automatically generating limits.h, and for checking that the values in an existing limits.h are correct

[edit] References

C Guide--2.5 limits.h, accessed in September 2006.