I want to use large positive integers (8 bytes) in my project, although sizeof (unsigned long) gives 8 on my system, I read that on most systems unsigned long there are only 4 bytes, and I decided to give unsigned long long a go, since it must be at least 8 bytes.
The more I use it, the more I saw that it is not very portable, for example, on some systems (depending on the compiler) printf formats it with% llu, in some it formats it with% lld.
My code will only work on 64-bit debian machines, in which the unsigned long will be 8 bytes. Portability is not a big problem. Is there an excessive use of unsigned long long unsigned long in these circumstances, are there other benefits to using unsigned long long over unsigned long?
source
share