View Single Post
Old 24-07-2009, 09:42 PM   #3
yoni0505
Forum hobbit

 
Join Date: Dec 2007
Location: Ramat Gan, Israel
Posts: 39
Default

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
yoni0505 is offline                         Send a private message to yoni0505
Reply With Quote