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.
thank you....
It means unsigned long long.
The % operator in C is the “modulo” operator, which has the same precedence as the * (multiply) and / (divide) operators. Its value is the remainder of the integer division of its two operands. For example, if x is 13, then the value of “x % 2” would be 1, since 13 divided by 2 is 6 with remainder 1.
Suffix ULL
to an integer represents type specifier. It means
unsigned long long
You may also like to read this and this one for more detail.
Those letters modify the literal 1
and make it of type unsigned long long
.
This is covered 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With