I have an array of bytes (char1) and I have to go through converting them to specific data types. For example the first two bytes in the array need to be converted to ascii characters so I just cast them using
c = string(char1[0])
but for char1[2] and char1[3] I need a 16bit unsigned integer so how would I go about combining those two bytes and casting them as uint? I'm looking for a general answer as I will need to convert to types ranging from 1 byte up to 8 bytes.
Thanks