Ok pretty much what I need to do is convert a byte to hex. Now obviously there is more to it than that. I also know there is no byte type in c++ so i need to figure out what to use as a substitute. Here is what I have right now.
char strNum; strNum = (char)0x10;
So basically the character strNum will contain the character created from the byte 00010000. Now my program works great like this. Now I have decided to change the implementation though. Basically 1 or a few bits will need to be changed in the byte. So i need to create somthing to represent the byte. I guess anything really, like an integer array or character array, but I need to know what would probably be best. Then I need to get that into strNum as a character. Im not sure how to do this. I dont know if it would be eaiser to convert it to hexadecimal some way and then cast it to a character or just convert it straight to a character. I dont know if you can even do it the first way since there is no hex data type. So basically in a little overview I need to be able to change any bit in a byte and then store it in a character type. Please let me know how you think I should go about this. Thank you
Red Flag Submitted
Thank you for helping keep Tek-Tips Forums free from inappropriate posts. The Tek-Tips staff will check this out and take appropriate action.
Reply To This Thread
Posting in the Tek-Tips forums is a member-only feature.