[C language]Handling 64-bit integers
Basically in C language, an unsigned number over 32 bit can not exceed the value of 4 294 967 295.
It may happen that you are required to handle higher numbers and for this you need these numbers to be coded in 64 bit.
However, this may not be handled in the same way as an ordinary integer. The constants and the posting of these numbers must be defined differently.
Unsigned 64-bit integer
Type: unsigned long long
Formatting for display: % llu
Suffix to define a constant: ULL
Example:
//Assign the value in a 4294967296
unsigned long long a= 4294967296ULL;
//Show the value
printf ( "% llu", a);
Signed 64-bit integer
Type: long long
Formatting for display: % lld
Suffix to define a constant: LL
Example:
//Assign the value in a 4294967296
long long a= 4294967296LL;
// Show the value
printf ( "% lld", a);
Using an unusual suffix to define a constant value
Unsigned long long a = 4294967296
Your compiler will prompt you that this number is too large for "long" typr. Ie a full 32 bits. The constants have such default. This concept is directly related to the architecture of 32-bit processors. A record 32-bit processor is limited and your default compiler will try to fit the numbers in one registry. But with a suffix such as LL and ULL, your compiler will store your number on 2 registers, i.e. on 64-bit, hence providing an optimized use.