What's the name of it?
double d1 = 0d;
decimal d2 = 0L;
float d3 = 0f;
And where can I find a character reference that I can use? If I want to do a cast from 0
to short
, is there any letter for this?
What's the name of it?
double d1 = 0d;
decimal d2 = 0L;
float d3 = 0f;
And where can I find a character reference that I can use? If I want to do a cast from 0
to short
, is there any letter for this?
What's the name of it?
There is no proper name for this, it is often referred to as suffix , numeric suffix or type suffix ).
And where can I find a character reference that I can use?
You can find a reference of the characters used by C # in this link (column Type Suffix ). Basically they are:
M
or m
to decimal . D
or d
to double . F
or f
to float . L
or l
to long . U
or u
to uint . UL
or ul
to ulong . It is optional to write in uppercase or lowercase, but it is recommended in the case of long to use the uppercase form to not confuse with the character 1
(one).
If I want to cast a cast from 0 to short, is there any letter for this?
No, the C # specification does not dedicate a suffix to short type (not for and char ).
Curiousness: for ulong type, in addition to UL
and ul
, any variation can be used with the letters L and U