Hi all,
this tiny little problem is frustrating the hell out of me. I've done this sort of operation many times in VB.NET with XOR without a problem, I believe the ^ operator in C# is XOR so I can't see why this is a problem(except that ^ is also considered a logical operator), but check it out. I simply want to XOR 2 bytes, and the compiler tells me that I cannot convert byte to int and that im missing a cast... how is this possible when i'm dealing only with bytes and the result of a XOR'd byte should be a byte.
code snippet
compiler errorCode:for(int i=0;i<bts.Length; i++) bts[i] = bts[i] ^ bts2[i];
which points to the "= bts[i]" partCode:Cannot implicitly convert type 'int' to 'byte'. An explicit conversion exists (are you missing a cast?) (CS0266) - .cs:80,14




Multi-Clipboard
Reply With Quote