关于C++中头文件<climits>
2014-09-02 13:23
567 查看
头文件<climits> 里面定义了各种datatype 的极限值。 常常我们需要使用这个极限值对数组, 变量等进行初始化。 该头文件下定义的宏如下:
Macro constants
name | expresses | value* |
---|---|---|
CHAR_BIT | Number of bits in a charobject (byte) | 8or greater* |
SCHAR_MIN | Minimum value for an object of type signed char | -127( -27+1) or less* |
SCHAR_MAX | Maximum value for an object of type signed char | 127( 27-1) or greater* |
UCHAR_MAX | Maximum value for an object of type unsigned char | 255( 28-1) or greater* |
CHAR_MIN | Minimum value for an object of type char | either SCHAR_MIN or 0 |
CHAR_MAX | Maximum value for an object of type char | either SCHAR_MAX or UCHAR_MAX |
MB_LEN_MAX | Maximum number of bytes in a multibyte character, for any locale | 1or greater* |
SHRT_MIN | Minimum value for an object of type short int | -32767( -215+1) or less* |
SHRT_MAX | Maximum value for an object of type short int | 32767( 215-1) or greater* |
USHRT_MAX | Maximum value for an object of type unsigned short int | 65535( 216-1) or greater* |
INT_MIN | Minimum value for an object of type int | -32767( -215+1) or less* |
INT_MAX | Maximum value for an object of type int | 32767( 215-1) or greater* |
UINT_MAX | Maximum value for an object of type unsigned int | 65535( 216-1) or greater* |
LONG_MIN | Minimum value for an object of type long int | -2147483647( -231+1) or less* |
LONG_MAX | Maximum value for an object of type long int | 2147483647( 231-1) or greater* |
ULONG_MAX | Maximum value for an object of type unsigned long int | 4294967295( 232-1) or greater* |
LLONG_MIN | Minimum value for an object of type long long int | -9223372036854775807( -263+1) or less* |
LLONG_MAX | Maximum value for an object of type long long int | 9223372036854775807( 263-1) or greater* |
ULLONG_MAX | Maximum value for an object of type unsigned long long int | 18446744073709551615( 264-1) or greater* |
相关文章推荐
- [C++STDlib基础]关于数学函数的介绍——C++标准库头文件<cmath>
- [C++STDlib基础]关于日期时间的操作——C++标准库头文件<ctime>
- C++语言零基础入门教程:2.2 C/C++头文件大揭秘,""和<>有什么区别
- 关于C++ 引用<初学写代码小记>
- <kingofark关于学习C++和编程的50个观点> 详解 - 预览版
- 关于c++中模板 T 无法限制的替代方案template< T extends Base>
- 关于C++ vector<S>使用时,错误 5 error C2719: “_Val”: 具有 __declspec(align('16')) 的形参将不被对齐
- C++中,关于#include<***.h>和#include"***.h"的区别
- C++学习:关于“std::vector<Type>::iterator”的一个错误
- C++头文件----<cstdio>(stdio.h)
- C++ win32 Sleep()头文件 #include <windows.h>
- 关于C++头文件#include<iostream.h>debug时提示文件目录不存在错误解决方法?
- [C++STDlib基础]关于字符串的操作——C++标准库头文件<cstring>
- [C++STDlib基础]关于单字符的操作——C++标准库头文件<cctype>
- [C++STDlib基础]关于C标准输入输出的操作——C++标准库头文件<cstdio>
- 关于#include<bits/stdc++.h>头文件的使用
- 关于 codeforces中的 int abs(int x) 还有头文件 # include <algorithm> 不带.h
- C++的头文件<iomanip>
- [C++STDlib基础]关于日期时间的操作——C++标准库头文件<ctime>
- C++中关于头文件<string>、<string.h>和<cstring>的区别