I\'m writing a C/C++ program that involves putting a hex representation of a number into a string and I\'m confused as to how \\x
works. I\'ve seen examples wh
The translation is done at compile-time so that every string you manually enter into the source code with \x
and such ends up being the character it represents in the binary. If you want to do this at run-time you will need to invoke a parse function like strtol()
using base 16 passing the string containing the hex and cast it to a char.