deleyd
asked on
Is a byte value signed or unsigned?
Is a byte value signed or unsigned?
byte x = 0xF4;
if (x == 244)
if (x == -11)
will they both work?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Byte variables are stored as unsigned 8-bit (1-byte) numbers ranging in value from 0 through 255
byte is an unsigned 8-bit integer, so on the example given only (x == 244) will return true.
byte (C# Reference)
http://msdn.microsoft.com/en-us/library/5bdb6693.aspx
byte (C# Reference)
http://msdn.microsoft.com/en-us/library/5bdb6693.aspx
You could have probably googled "c# byte" faster than typing in this question :-)