// 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;
}
2017.05.02 有关limits头文件的学习
最新推荐文章于 2024-07-06 13:15:05 发布