C语言 c语言中“1ULL”是什么意思
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17795722/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the meaning of "1ULL"in c programming language
提问by user2608075
for (x = 0; x < 1ULL<<(2*length); ++x){
this above line is a c program code which I downloaded. It has a part "1ULL". First I thought it was a mistake. but the code compiles and works well. can anyone please explain me what is that thing mean.
上面这行是我下载的 ac 程序代码。它有一个部分“1ULL”。首先我认为这是一个错误。但代码编译并运行良好。任何人都可以请解释我那东西是什么意思。
thank you....
谢谢你....
回答by haccks
回答by Brian Cain
Those letters modify the literal 1and make it of type unsigned long long.
这些字母修改文字1并使其成为 type unsigned long long。
This is covered in C99 (ISO/IEC 9899) §6.4.4.1 Integer constants:
这在 C99 (ISO/IEC 9899) §6.4.4.1 整数常量中有所涉及:
integer-suffix: unsigned-suffix long-suffixopt unsigned-suffix long-long-suffix long-suffix unsigned-suffixopt long-long-suffix unsigned-suffixopt unsigned-suffix: one of u U long-suffix: one of l L long-long-suffix: one of ll LL
integer-suffix: unsigned-suffix long-suffixopt unsigned-suffix long-long-suffix long-suffix unsigned-suffixopt long-long-suffix unsigned-suffixopt unsigned-suffix: one of u U long-suffix: one of l L long-long-suffix: one of ll LL
回答by nouney
It's a way to signal to the compiler that the value must be considered as a unsigned long long.
这是一种向编译器发出信号,表明该值必须被视为unsigned long long.

