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

for (x = 0; x < 1ULL<<(2*length); ++x){ 

This line above is the c code I downloaded. It has a "1ULL" part. At first I thought it was a mistake. but the code compiles and works well. can someone explain to me what this means?

thanks....

+7
c
source share
3 answers

The suffix ULL to an integer represents a type specifier. It means

 unsigned long long 

You can also read this and this for more details.

+9
source share

These letters modify literal 1 and make it type unsigned long long .

This is described in C99 (ISO / IEC 9899) ยง6.4.4.1 Integer constants:

 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 
+3
source share

This is a way to tell the compiler that the value should be treated as an unsigned long long .

+3
source share

All Articles