limits头文件使用

c++中提供了一个limits库,可以直接得到各数值类型的最大、最小值。
这里简略记录下以方便后续查阅。使用方式如下:

#include 
#include 

using namespace std;

int main(){
    // int32
    cout<::max()<::min()<::max()<::min()<

include

include

using namespace std;
int main(){
// int32
cout< cout< cout< cout< cout< cout< }

你可能感兴趣的:(limits头文件使用)