Actually, long long
is guaranteed to be at least 64 bits by the C implementation limits header <climits>
. The minimum limit on the minimum and maximum values for an object of type long long
is given as:
LLONG_MIN -9223372036854775807 // −(2^63 − 1)
LLONG_MAX +9223372036854775807 // 2^63 − 1
This corresponds to a signed 64 bit integer. You cannot store such a range of values without at least 64 information bits.
So go ahead and use 0x1234LL
. In fact, you can just as much use no suffix, because the first of the following types that can fit the value will be chosen:
Suffix | Decimal constants | Octal or hexadecimal constant
-------|-------------------|------------------------------
none | int | int
| long int | unsigned int
| long long int | long int
| | unsigned long int
| | long long int
| | unsigned long long int
... | ... | ...