Tag: 数值限制

警告C4003和错误C2589和C2059:x = std :: numeric_limits <int> :: max();

这行在一个小testing程序中正常工作,但是在我想要的程序中,我得到了下面的编译器投诉: #include <limits> x = std::numeric_limits<int>::max(); c:\…\x.cpp(192) : warning C4003: not enough actual parameters for macro 'max' c:\…\x.cpp(192) : error C2589: '(' : illegal token on right side of '::' c:\…\x.cpp(192) : error C2059: syntax error : '::' 我得到相同的结果: #include <limits> using namespace std; x = numeric_limits<int>::max(); 为什么它将max看作macrosmax(a,b); ?