# <limits.h> <limits.h> # `` * * * Include the standard header **``** to determine various properties of the integer type representations. The standard header `` is available even in a [freestanding implementation](https://docs.qualcomm.com/doc/80-N3040-23/topic/cpp_lib_over.html#freestanding%20implementation). You can test the values of all these macros in an [*if* directive](https://docs.qualcomm.com/doc/80-N3040-23/topic/cpp_preproc.html#if%20directive). (The macros are [*#if* expressions](https://docs.qualcomm.com/doc/80-N3040-23/topic/cpp_preproc.html#if%20expression).) #define CHAR_BIT <#if expression >= 8> #define CHAR_MAX <#if expression >= 127> #define CHAR_MIN <#if expression <= 0> #define SCHAR_MAX <#if expression >= 127> #define SCHAR_MIN <#if expression <= -127> #define UCHAR_MAX <#if expression >= 255> #define MB_LEN_MAX <#if expression >= 1> #define SHRT_MAX <#if expression >= 32,767> #define SHRT_MIN <#if expression <= -32,767> #define USHRT_MAX <#if expression >= 65,535> #define INT_MAX <#if expression >= 32,767> #define INT_MIN <#if expression <= -32,767> #define UINT_MAX <#if expression >= 65,535> #define LONG_MAX <#if expression >= 2,147,483,647> #define LONG_MIN <#if expression <= -2,147,483,647> #define ULONG_MAX <#if expression >= 4,294,967,295>Copy to clipboard ## `CHAR_BIT` #define CHAR_BIT <#if expression >= 8>Copy to clipboard The macro yields the maximum value for the number of bits used to represent an object of type *char.* ## `CHAR_MAX` #define CHAR_MAX <#if expression >= 127>Copy to clipboard The macro yields the maximum value for type *char.* Its value is: - [`SCHAR_MAX`](https://docs.qualcomm.com/doc/80-N3040-23/topic/cpp_limits.html#SCHAR_MAX) if *char* represents negative values - [`UCHAR_MAX`](https://docs.qualcomm.com/doc/80-N3040-23/topic/cpp_limits.html#UCHAR_MAX) otherwise ## `CHAR_MIN` #define CHAR_MIN <#if expression <= 0>Copy to clipboard The macro yields the minimum value for type *char.* Its value is: - [`SCHAR_MIN`](https://docs.qualcomm.com/doc/80-N3040-23/topic/cpp_limits.html#SCHAR_MIN) if *char* represents negative values - zero otherwise ## `INT_MAX` #define INT_MAX <#if expression >= 32,767>Copy to clipboard The macro yields the maximum value for type *int.* ## `INT_MIN` #define INT_MIN <#if expression <= -32,767>Copy to clipboard The macro yields the minimum value for type *int.* ## `LONG_MAX` #define LONG_MAX <#if expression >= 2,147,483,647>Copy to clipboard The macro yields the maximum value for type *long.* ## `LONG_MIN` #define LONG_MIN <#if expression <= -2,147,483,647>Copy to clipboard The macro yields the minimum value for type *long.* ## `MB_LEN_MAX` #define MB_LEN_MAX <#if expression >= 1>Copy to clipboard The macro yields the maximum number of characters that constitute a [multibyte character](https://docs.qualcomm.com/doc/80-N3040-23/topic/cpp_charset.html#Multibyte%20Characters) in any supported [locale](https://docs.qualcomm.com/doc/80-N3040-23/topic/cpp_locale.html). Its value is >= [`MB_CUR_MAX`](https://docs.qualcomm.com/doc/80-N3040-23/topic/cpp_stdlib.html#MB_CUR_MAX). ## `SCHAR_MAX` #define SCHAR_MAX <#if expression >= 127>Copy to clipboard The macro yields the maximum value for type *signed char.* ## `SCHAR_MIN` #define SCHAR_MIN <#if expression <= -127>Copy to clipboard The macro yields the minimum value for type *signed char.* ## `SHRT_MAX` #define SHRT_MAX <#if expression >= 32,767>Copy to clipboard The macro yields the maximum value for type *short.* ## `SHRT_MIN` #define SHRT_MIN <#if expression <= -32,767>Copy to clipboard The macro yields the minimum value for type *short.* ## `UCHAR_MAX` #define UCHAR_MAX <#if expression >= 255>Copy to clipboard The macro yields the maximum value for type *unsigned char.* ## `UINT_MAX` #define UINT_MAX <#if expression >= 65,535>Copy to clipboard The macro yields the maximum value for type *unsigned int.* ## `ULONG_MAX` #define ULONG_MAX <#if expression >= 4,294,967,295>Copy to clipboard The macro yields the maximum value for type *unsigned long.* ## `USHRT_MAX` #define USHRT_MAX <#if expression >= 65,535>Copy to clipboard The macro yields the maximum value for type *unsigned short.* * * * See also the **[Table of Contents](https://docs.qualcomm.com/doc/80-N3040-23/topic/cpp_index.html#Table%20of%20Contents)** and the **[Index](https://docs.qualcomm.com/doc/80-N3040-23/topic/_cpp_index.html)**. *[Copyright](https://docs.qualcomm.com/doc/80-N3040-23/topic/cpp_crit_pjp.html) © 1992-2006by P.J. Plauger and Jim Brodie. All rights reserved.* Last Published: Oct 06, 2026 Previous Topic Next Topic