2008年4月21日 星期一

Header file: limits

==== 2007年10月31日11:38 发布于 redspid.blog.163.com ====
C++ 内建类型取值范围:


1
# include <iostream>
2 # include <limits>
3
4 using namespace std;
5
6 int main() {
7 // C++ 内建类型的 最大、最小 值
8 long unsigned int i = numeric_limits<unsigned int>::max();
9 long double j = numeric_limits<double>::min();
10
11 cout<<i<<endl;
12 cout<<j<<endl;
13 }

0 评论: