#include <limits>
#include <iostream>
using namespace std;
int main( )
{
int max_int = numeric_limits< int >::max( );
cout << "int: " << sizeof( int );
cout << ", " << max_int << endl;
long max_long = numeric_limits< long >::max( );
cout << "long: " << sizeof( long );
cout << ", " << max_long << endl;
float max_float = numeric_limits< float >::max( );
cout << "float: " << sizeof( float );
cout << ", " << max_float << endl;
}
C++中获取一个原生数据类型能表示的最大值
最新推荐文章于 2024-08-08 19:31:27 发布