Cant seem to find the answer to this, I’m sure it’s simple, but just want to understand this so I can move on.
I’m looking at integer types, and am wondering why this:
long number = 645456645;
has the same effect as:
long number = 654456654L;
What is the point of using that letter ‘L’ at the end? Same with the ‘U’ for unsigned case.
Strictly speaking, the two are not equivalent.
645456645has typeintand is converted tolongfor the initialisation.longso no conversion is performed.In this trivial example there’s obviously no functional difference, but on a platform where the range of
longis not the same as the range ofint, you may find that you have to use theLsuffix to actually get the valid literal in the first place.