Skip to content

C#: XOR operation got error Cannot implicitly convert type int to byte.

March 25, 2017

How to solve error ” error CS0266: Cannot implicitly convert type ‘int’ to ‘byte’. An explicit conversion exists (are you missing a cast?)” in C#: XOR operation? Just pust cast as byte to final operation

 

  1. before:  output[i] = ((oper1[j] ^ oper2[j]) ^ oper3[i]);
  2. after:  output[i] = (byte)((oper1[j] ^ oper2[j]) ^ oper3[i]);
Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: