Draft 2002-02-20

<climits>

The <climits> header (from the C standard <limits.h> header) defines parameters that characterize integral types. See <cfloat> for the C characterization of the floating point types.

The native C++ header, <limits>, defines the same information (and more), but without cumbersome macros. When writing new C++ code, use <limits> instead of <climits>.

The types for the _MIN and _MAX macros are reminders to the reader and are not descriptive of the actual types of the macro expansions. The actual type can be any integral type that would be the result of normal integral promotions for the corresponding type, e.g., unsigned char can be promoted to unsigned int, so UCHAR_MAX might have type unsigned int.

All of the macros in <climits> expand to constant expressions.

CHAR_BIT macro

Syntax

int CHAR_BIT

Description

Number of bits per character.

CHAR_MAX macro

Syntax

char CHAR_MAX

Description

Maximum value for the char type. (Is the same as SCHAR_MAX or UCHAR_MAX.)

CHAR_MIN macro

Syntax

char CHAR_MIN

Description

Minimum value for the char type. (Is the same as SCHAR_MIN or UCHAR_MIN.)

INT_MAX macro

Syntax

int INT_MAX

Description

Maximum value for the int type.

INT_MIN macro

Syntax

int INT_MIN

Description

Minimum value for the int type.

LONG_MAX macro

Syntax

long int LONG_MAX

Description

Maximum value for the long int type.

LONG_MIN macro

Syntax

long int LONG_MIN

Description

Minimum value for the long int type.

MB_LEN_MAX macro

Syntax

int MB_LEN_MAX

Description

Maximum number of bytes in any multibyte character, in any locale.

SCHAR_MAX macro

Syntax

signed char SCHAR_MAX

Description

Maximum value for the signed char type.

SCHAR_MIN macro

Syntax

signed char SCHAR_MIN

Description

Minimum value for the signed char type.

SHRT_MAX macro

Syntax

short SHRT_MAX

Description

Maximum value for the short type.

SHRT_MIN macro

Syntax

short SHRT_MIN

Description

Minimum value for the short type.

UCHAR_MAX macro

Syntax

unsigned char UCHAR_MAX

Description

Maximum value for the unsigned char type.

UINT_MAX macro

Syntax

unsigned int UINT_MAX

Description

Maximum value for the unsigned int type.

ULONG_MAX macro

Syntax

unsigned long ULONG_MAX

Description

Maximum value for the unsigned long type.

USHRT_MAX macro

Syntax

unsigned short USHRT_MAX

Description

Maximum value for the unsigned short type.