Hi, I'm new to Netduino and C#
in my first project I have a casting problem.
this code :
byte checkSum = 0 ;byte[] dataFrame = new byte[5];checkSum = dataFrame[2] ^ dataFrame[3];
gives me this error :
Cannot implicitly convert type 'int' into 'byte'. An explicit conversion exists (are you missing a cast?)
but, this way, it works
byte checkSum = 0 ;byte[] dataFrame = new byte[5]; checkSum = dataFrame[2];checkSum ^= dataFrame[3];
does anybody know why the first code doesn't work.
I would prefer to use only one line of code instead of two for this operation, and like to understand what went wrong?
tx,
Olivier