I am trying to convert char array to byte. But I am getting the below error:
Cannot implicitly convert int to byte
public byte[] asciiToDecConversion(char[] asciiCharArray)
{
byte[] decimalArray = new byte[10];
const byte asciiFormat = 32;
for (int j = 0; j < 10; j++)
{
decimalArray[j] = (Convert.ToByte(asciiCharArray[j]) - asciiFormat);
}
return decimalArray;
}