I'm trying to do something that, in my opinion, would be pretty simple, but I'm just ignoring something obvious or it is actually a bit complicated. My problem: I have a 4 character array that contains 4 hexadecimal values. For instance:
array[0] = 0xD8
array[1] = 0xEC
array[2] = 0xA2
array[3] = 0x83
I want to store this array as an integer with a combined value, in this case 0xD8ECA283
I tried doing a logical OR, and then changing the bits, and with this method I was able to save the value 0xD8 in an integer, but not otherwise. Any advice would be appreciated.
source
share