检查长使用类型的限制
std::cout << std::numeric_limits<long long>::min();
Run Code Online (Sandbox Code Playgroud)
我得到-9223372036854775808
但是在编译以下代码时:
int main() {
long long l;
l=-9223372036854775808LL;
}
Run Code Online (Sandbox Code Playgroud)
我收到警告:
test.cpp:3:7: warning: integer constant is so large that it is unsigned.
test.cpp:3: warning: this decimal constant is unsigned only in ISO C90
Run Code Online (Sandbox Code Playgroud)
我错过了什么?非常感谢您的帮助.
乔治