I'd like to take the ascii characters 4 and 0 (so x34 and x30) and print out the ascii character for x40, how do I do this? I know my output will be some weird character that will probably make no sense on the screen when I output it, but that's ok.
I'd like to take the ascii characters 4 and 0 (so x34 and x30) and print out the ascii character for x40, how do I do this? I know my output will be some weird character that will probably make no sense on the screen when I output it, but that's ok.
Take the characters 4 & 0 and put it in a string. Now convert it to an interger using atoi. Then you can treat that value as a hex value by writing your own conversion function and returning the integer that corresponds with the hex value. Now you can print that ascii character.
e.g.
int i;
string[] = {'4', '0'};
i = (int)atoi(string);
i = HexToInt(i);
printf("%c", i);