"climits" Header file in c++ programming language | Razsoft Education

 <climits> header file

climits is a header file borrowed from c programing language limit.h header file. The header file is used to know the maximum and minimum value an integer data type can hold. The header file is implemented in C++ in standard namespace. 

Here is the explanation of Macros used in climits header file

char type :

    CHAR_BIT - The macro represent number of bit in a character.
    CHAR_MIN -  For the minimum value a char can hold.
    CHAR_MAX -  For the maximum value a char can hold. 
    CHAR_MIN -  For the minimum value a char can hold.
    SCHAR_MIN -  For the minimum value a signed char can hold.
    SCHAR_MAX -  For the maximum value a char can hold.
    UCHAR_MAX - For the minimum value of unsigned char.

short type :

    SHRT_MIN - For the minimum value a short can hold.
    SHRT_MAX - For the maximum value a short integer can hold.
    USHRT_MIN - For the maximum value a unsigned short integer can hold.

int type :

    INT_MIN - For the minimum value a integer can hold.
    INT_MAX - For the maximum value a integer can hold.
    UINT_MAX - For the maximum value a unsigned integer can hold.

long type :

LONG_MIN - For the minimum value a long integer can hold.
LONG_MAX - For the maximum value a long integer can hold.
ULONG_MAX - For the maximum value a unsigned long integer can hold.

long long type :

LLONG_MIN - For the minimum value a long long integer can hold.
LLONG_MAX - For the maximum value a long long integer can hold.
ULLONG_MAX- For the minimum value a unsigned long long integer can hold.

  • Minimum value for all unsigned integer types is 0.
  • long long was introduced in C++11 so, previous compilers may not have LLONG_MIN, LLONG_MAX and ULLONG_MAX macros defined in it. 

Comments

Popular posts

Integer data type in C++ programming language | Razsoft education

Computer graphics with java an introduction | Razsoft Education