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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 06:59:33  来源:igfitidea点击:

What is the meaning of "1ULL"in c programming language

c

提问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

Suffix ULLto an integer represents type specifier. It means

ULL整数的后缀表示类型说明符。它的意思是

unsigned long long

You may also like to read thisand this onefor more detail.

您可能还想阅读以了解更多详细信息。

回答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.