Limits.h Header file

This Limits.h Header file page explains clearly about all the constant variables available in Limits.h header file with suitable examples.


 

limits.h:

  • ​limits.h header file contains pre-defined variables represent limits of each data type.
  • These variables are global (can be accessed from anywhere).
  • These variables are constants (cannot be modified)

#include <stdio.h>
#include <limits.h>
main()
{
          printf(“Signed short min value : %d\n”, SHRT_MIN );
          printf(“Signed short max value : %d\n”, SHRT_MAX );
          printf(“Unsigned short max value: %u\n”, UCHAR_MAX );
}

  
#include <stdio.h>
#include <limits.h>
main()
{
          printf(“Unsigned short min value: %u\n”, UCHAR_MIN );
}

Share this