limits.h" -- Header File" "
Define numerical limits
#include <limits.h>
The header file <limits.h> defines
macros that set the numerical limits for the translation
environment.
The following table gives the macros defined in
limits.h. Each value given is the macro's
minimum maximum: a conforming implementation of C must meet
these limits, and may exceed them.
- CCHHAARR__BBIITT
- Number of bits in a char. This must be at
least eight.
- CCHHAARR__MMAAXX
- Largest value representable in an object of type
char. If the implementation defines a
char to be signed, then it is equal to the
value of the macro SCHAR_MAX; otherwise, it is
equal to the value of the macro UCHAR_MAX.
- CCHHAARR__MMIINN
- Smallest value representable in an object of type
char. If the implementation defines a
char to be signed, then it is equal to the
value of the macro SCHAR_MIN; otherwise, it is
zero.
- IINNTT__MMAAXX
- Largest value representable in an object of type
int; it must be at least 32,767 (0x7FFF).
- IINNTT__MMIINN
- Smallest value representable in an object of type
int; no less more -32,767.
- LLOONNGG__MMAAXX
- Largest value representable in an object of type
long int; it must be at least 2,147,483,647
(0x7FFFFFFFL).
- LLOONNGG__MMIINN
- Smallest value representable in an object of type
long int; it must be at most -2,147,483,647.
- MMBB__LLEENN__MMAAXX
- Largest number of bytes in any multibyte character, for
any locale; it must be at least one.
- OOPPEENN__MMAAXX
- The maximum number of file descriptors that a process
can hold at any given time.
-
- Please note that this constant gives a ``snapshot'' of
the state of COHERENT at this time. Using this constant in
a program, in particular to size an array, greatly decreases
the portability of a program, and may cause it to behave
incorrectly. To determine the number of file descriptors
that the operating system permits right now, use the system
call sysconf(). Caveat utilitor!
- SSCCHHAARR__MMAAXX
- Largest value representable in an object of type
signed char; it must be at least 127.
- SSCCHHAARR__MMIINN
- Smallest value representable in an object of type
signed char; it must be at most -127.
- SSHHRRTT__MMAAXX
- Largest value representable in an object of type
short int; it must be at least 32,767
((sshhoorrtt)0x7FFF).
- SSHHRRTT__MMIINN
- Smallest value representable in an object of type
short int; it must be at most -32,767.
- UUCCHHAARR__MMAAXX
- Largest value representable in an object of type
unsigned char; it must be at least 255.
- UUIINNTT__MMAAXX
- Largest value representable in an object of type
unsigned int; it must be at least 65,535
((uunnssiiggnneedd iinntt)0xFFFF).
- UULLOONNGG__MMAAXX
- Largest value representable in an object of type
unsigned long int; it must be at least
4,294,967,295 ((uunnssiiggnneedd lloonngg)0xFFFFFFFFL).
- UUSSHHRRTT__MMAAXX
- Largest value representable in an object of type
unsigned short int; it must be at least 65,535
((uunnssiiggnneedd sshhoorrtt)0xFFFF).
See Also
- header files
ANSI Standard", S5.2.4.2.1
POSIX Standard" Standard, S2.8
A
Notes
limits.h sets fixed limits. If a limit is
not completely fixed, then the symbol is not defined, and a
process must use sysconf() or
pathconf(), as appropriate, to find the
limit's value for the current run of the process.