I have a string that comes from another program and looks like 414243 etc. and I want cast the values to hex (not convert) them for use in a char/unsigned char vector or array. E.g. char array[] = "\x41\x42\x43". Looking for guidance on how this can be done. I mainly have found answers on converting to hex, but that is not quite what I need to do. Any help would be appreciated.