This question already has answers here:
Testing for a maximum unsigned value

(6个答案)


已关闭8年。




这就是我想要的:
unsigned int max_unsigned_int_size;
max_unsigned_int_size = ???;

我应该怎么做?

最佳答案

C

#include <limits.h>
unsigned int max_unsigned_int_size = UINT_MAX;

C++
#include <limits>
unsigned int max_unsigned_int_size = std::numeric_limits<unsigned int>::max();

关于c++ - 无符号整数的最大值,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/15889253/

10-09 04:19