Hi all,
I was wondering how i can turn two bytes into a character.
What i think i need to do is to assign the two bytes into an int and then cast this int to a char.
However how do i create the int so that it reflects the correct char value. I know i need to use one/or two of the bit-wise operators. I need to take the b bits in the first byte and put them in positions 8 to 15 in the int. Then i need to take the 8 bits in the second byte and place them in positions 0 to 7 in the int. Can anyone tell me how exactly i should do this. My experimentation with the bit-wise operators has not been too successfull so far
thanks,
John
I was wondering how i can turn two bytes into a character.
What i think i need to do is to assign the two bytes into an int and then cast this int to a char.
However how do i create the int so that it reflects the correct char value. I know i need to use one/or two of the bit-wise operators. I need to take the b bits in the first byte and put them in positions 8 to 15 in the int. Then i need to take the 8 bits in the second byte and place them in positions 0 to 7 in the int. Can anyone tell me how exactly i should do this. My experimentation with the bit-wise operators has not been too successfull so far
thanks,
John