Ushort To Byte convert
using System;
class MainClass
{
static void Main()
{
ushort sh = 10;
byte sb = (byte)sh;
Console.WriteLine("sb: {0} = 0x{0:X}", sb);
sh = 1365;
sb = (byte)sh;
Console.WriteLine("sb: {0} = 0x{0:X}", sb);
}
}
Output sb: 10 = 0xA
sb: 85 = 0x55
|
HTML code for linking to this page:
Related in same category :
-
-
|