If I compile 32-bit code using these types, will I experience performance problems on 64-bit and / or 32-bit machines?
For the compiler, you may need to generate several machine code instructions to perform operations on 64-bit values, which somewhat slows down these operations. If this could be a problem, you would like to conduct a comparative analysis to assess the impact of a particular program on realistic data. This problem exists where you are executing a 32-bit executable on a 32- or 64-bit machine.
Would I ever have a reason to just use int ?
In addition to performance and memory usage, sometimes it becomes necessary to use int , because other APIs / threads, etc. that you work with using int . There is also subtle documentary value when using int , if it is explicitly adequate, otherwise other programmers may lose time wondering why you have avoided using long long .
In the end, 64-bit ints are much more useful to store large numbers.
It is much more useful to store very large numbers - of course - but this is relatively rarely necessary. If you store something like a year or someone of age, it just doesn't make much sense to have 64 bits.
source share