i understand what is hex and i know how to translate it into decimal, the problem is that i need to separate the decimal value into 2 bytes in two different variables, its pretty simple but i still dont know how to do it with C++
example:
lets say i got the decimal number 30,000
in hex its 7530
means the first byte is 75 and the second is 30
now i need to save each of the bytes on different vars
btw i cant just write 7530 to the file, it will only save the first byte, this why i need 2 different vars
|