2017.05.02 有关limits头文件的学习

来源:互联网 发布:网络蜘蛛 磁力搜索 编辑:程序博客网 时间:2024/06/12 00:57
// a13.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>#include <climits>using namespace std;int _tmain(int argc, _TCHAR* argv[]){int n_int=INT_MAX;short n_short=SHRT_MAX;long n_long=LONG_MAX;long long n_llong=LLONG_MAX;cout<<"int is "<<sizeof(int)<<" bytes."<<endl;cout<<"short is "<<sizeof(short)<<" bytes"<<endl;cout<<"long is "<<sizeof(long)<<" bytes."<<endl;cout<<"long long is "<<sizeof(long long)<<" bytes."<<endl;cout<<endl<<endl;cout<<"Maximum Values:"<<endl;cout<<"int: "<<n_int<<endl;cout<<"short: "<<n_short<<endl;cout<<"long: "<<n_long<<endl;cout<<"long long: "<<n_llong<<endl;return 0;}

1 0
原创粉丝点击