13.8 climits

   

13.8 <climits>

The <climits> header (from the C standard < limits.h> header) defines parameters that characterize integral types in the same way <cfloat> does for the floating point types. The native C++ header, <limits> , defines the same information (and more) using templates instead of macros.

figs/acorn.gif

The types used in the descriptions of the _MIN and _MAX macros are meant as reminders and are not descriptive of the actual types of the macro expansions. The actual types are implementation-defined and can be any integral type that would be the result of normal integral promotions for the corresponding typee.g., if unsigned char is promoted to int , UCHAR_MAX might have type int .

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

CHAR_BIT macro Bits per character

 int  CHAR_BIT  

Number of bits per character. The value is always at least 8.

CHAR_MAX macro Maximum char value

 char  CHAR_MAX  

Maximum value for the char type. (Remember that the char type is the same as either signed char or unsigned char , so CHAR_MAX has the same value as SCHAR_MAX or UCHAR_MAX .)

See Also

WCHAR_MAX in <cwchar>

CHAR_MIN macro Minimum char value

 char  CHAR_MIN  

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

See Also

WCHAR_MIN in <cwchar>

INT_MAX macro Maximum int value

 int  INT_MAX  

Maximum value for the int type. The value is always at least 32,767.

INT_MIN macro Minimum int value

 int  INT_MIN  

Minimum value for the int type. The value is always less than or equal to -32,767.

LONG_MAX macro Maximum long value

 long int  LONG_MAX  

Maximum value for the long int type. The value is always at least 2,147,483,647.

LONG_MIN macro Minimum long value

 long int  LONG_MIN  

Minimum value for the long int type. The value is always less than or equal to -2,147,483,647.

MB_LEN_MAX macro Maximum bytes in a multibyte character

 int  MB_LEN_MAX  

Maximum number of bytes in any multibyte character, in any locale. The value is always at least 1.

SCHAR_MAX macro Maximum signed char value

 signed char  SCHAR_MAX  

Maximum value for the signed char type. The value is always at least 127.

SCHAR_MIN macro Minimum signed char value

 signed char  SCHAR_MIN  

Minimum value for the signed char type. The value is always less than or equal to -127.

SHRT_MAX macro Maximum short value

 short  SHRT_MAX  

Maximum value for the short type. The value is always at least 32,767.

SHRT_MIN macro Minimum short value

 short  SHRT_MIN  

Minimum value for the short type. The value is always less than or equal to -32,767.

UCHAR_MAX macro Maximum unsigned char value

 unsigned char  UCHAR_MAX  

Maximum value for the unsigned char type. The value is always at least 255.

UINT_MAX macro Maximum unsigned int value

 unsigned int  UINT_MAX  

Maximum value for the unsigned int type. The value is always at least 65,535.

ULONG_MAX macro Maximum unsigned long value

 unsigned long  ULONG_MAX  

Maximum value for the unsigned long type. The value is always at least 4,294,967,295.

USHRT_MAX macro Maximum unsigned short value

 unsigned short  USHRT_MAX  

Maximum value for the unsigned short type. The value is always at least 65,535.

   


C++ in a Nutshell
C++ in a Nutshell
ISBN: 059600298X
EAN: 2147483647
Year: 2005
Pages: 270
Authors: Ray Lischner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net