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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top