byte arithmetic

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I tried subtracting and xor'ing two bytes (in C#)

Looks like the result is... an int ??

byte is included in the integer datatypes, and arithmetic & bitwise operations are defined for those

Is there a reason for the result to promote, or have I misunderstood the implementation

tia...
 
They are always going to cast since byte is a second class citizen under C#.
You need to cast back down to byte when you are done. This can be extremely
tedious at times, let me tell you.
 
Back
Top