为什么这段代码:
#include <stdio.h>
int main(int argc, char** argv) {
printf("%lld\n", 4294967296LL);
}
为 Windows 发出这个:
0
但这适用于 Linux:
4294967296
最佳答案
这是因为 Visual Studio C++ 2003 及更早版本不支持 %lld。但是这段代码可以工作:
#include <stdio.h>
int main(int argc, char** argv) {
printf("%I64d\n", 4294967296LL);
}
关于c - Windows 上的 %lld 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/664015/