I've been working on a char to hex converter all day, and it's working.
Except for one part.
I've got an unsigned short I want seperated into the two hex values. I've been beating on this stupid bit of code all day, and it's just not working.
The hex representation is to be stored in a CString, because I've found they are very handy.
itoa doesn't help, and the cstring .Format doesn't seem to allow printing as a char array, either.
The closest I've gotten is assigning the correct byte value(but not as characters) in a CString.
CString str1,str2; unsigned short test = 0x1234; str2 = (test>>8); //this gives test having '12', as an integer value, and useless symbol. str1=str2; /*Or with concatenation, doesn't help... Doing this because str1 is going to be displayed on the screen, but str2 is used for formatting.*/
I'm sure the solution is really mindnumbingly simple, but I've been somehow able to struggle with this stupid thing for hours.
Thanks for your time.