Hi rtn,
This is a tricky question. Still, there is no implicit numeric conversion defined for
ushort
to
char
. The only valid thing is vice-versa, from
char
to
ushort
.
In short, there are no implicit conversions to
char
type, so the values of the other integral types do not automatically convert to the
char
type.
The implicit numeric conversions are:
- From
sbyte
to short, int, long, float, double, or decimal.
- From
byte
to short, ushort, int, uint, long, ulong, float, double, or decimal.
- From
short
to int, long, float, double, or decimal.
- From
ushort
to int, uint, long, ulong, float, double, or decimal.
- From
int
to long, float, double, or decimal.
- From
uint
to long, ulong, float, double, or decimal.
- From
long
to float, double, or decimal.
- From
ulong
to float, double, or decimal.
- From
char
to ushort, int, uint, long, ulong, float, double, or decimal.
For example, this will work just fine:
char ch = '1';
ushort vushort;
vushort = ch;
Hope this helps.
Cheers