C / C ++中的(limits.h) 
                
            头文件“limits.h”以C语言存在,而<climits>以C++语言存在。在这些头文件中定义了几个宏。限制指定变量不能存储超出限制的值。
“limits.h”或<climits>头文件中的一些宏如下
这是C++语言中<climits>的示例,
示例
#include<iostream>
#include <bits/stdc++.h>
#include<climits>
using namespace std;
int main() {
   int x = 28;
   int a = CHAR_BIT*sizeof(x);
   stack<bool> s;
   cout << "The number is : " << x << endl;
   for (int i=1; i<=a; i++) {
      s.push(x%2);
      x = x/2;
   }
   cout << "The number of bits in a byte : " << CHAR_BIT << endl;
   for (int i=1; i<=a; i++) {
      cout << s.top();
      s.pop();
      if (i % CHAR_BIT == 0)
      cout << " ";
   }
   cout << "\n\nThe minimum value of short int :" << SHRT_MIN;
   return 0;
}输出结果
The number is : 28 The number of bits in a byte : 8 00000000 00000000 00000000 00011100 The minimum value of short int :-32768
在上面的程序中,表示了<climits>的两个宏。一个是CHAR_BIT,另一个是SHRT_MIN。CHAR_BIT定义char中的位数,而SHRT_MIN定义shortint的最小值。
int x = 28; int a = CHAR_BIT*sizeof(x); …. cout << "\n\nThe minimum value of short int :" << SHRT_MIN;
