In C#, how would I go about setting 2 bytes where the first 10 bits represent one decimal value and the next 6 represent a different decimal value?
So if the first value was ‘8’ (first 10 bits) and the second ‘2’ (remaining 6 bits), I need to end up with ‘0000001000 000010’ inside a byte array.
Thanks!
Ad
If you need it in a byte array, you can pass the result to the
BitConverter.GetBytesmethod.