When do we need to mention/specify the type of integer for number literals?
c, c++, integer, types
Solution
In C, a hexadecimal literal gets the first type of `int`, `unsigned int`, `long`, `unsigned long`, `long long` or `unsigned long long` that can represent its value if it has no suffix. I wouldn't be surprised if C++ has the same rules.
You would need a suffix if you want to give a literal a larger type than it would have by default or if you want to force its signedness, consider for example
1 << 43;
Without suffix, that is (almost certainly) undefined behaviour, but `1LL << 43;` for example would be fine.
Problem
I came across a code like below: ``` #define SOME_VALUE 0xFEDCBA9876543210ULL ``` This `SOME_VALUE` is assigned to some `unsigned long long` later. Questions: - Is there a need to have postfix like `ULL` in this case ? - What are the situation we need to specify the type of integer used ? - Do C and C++ behave differently in this case ?