用惯C#,比如我想让一个int数等于无穷大,只需要简单写:
[code=’c#’]
int a = int.MaxValue;
[/code]
转到C++上,疑惑了…
首先C++不会有属性这种东西,而且不同平台上的某个类型的最大最小值是不一样的。
解决方案是使用limits头文件的方法。
[code=’cpp’]
#include
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
cout<<"short:"<
1 comment