Is there some formal standards that do not allow one to use the ^ or XOR function in C# with two chars?
public char[] XORinput(char[] input, char SN)
{
int InputSize = input.Length;
//initialize an output array
char[] output = new char[InputSize];
for (int i = 0; i < InputSize; i++)
{
output[i] = input[i] ^ SN;
}
return output;
}
For whatever reason this code is giving me this error, Error 1400 Cannot implicitly convert type 'int' to 'char'. An explicit conversion exists (are you missing a cast?)
This does not make any sense.
Caller:
string num = "12345";
char SN = Convert.ToChar(num);//serial number
string sCommand = ("Hellow");
char[] out = new char[sCommand.ToCharArray().Length];
out = calculator.XORinput(sCommand.ToCharArray(), SN);