I have searched here for an answer and either didn't find it or didn't understand it.
I need to convert a std::string such as "F1F2F3F4" (8 bytes) to bytes \xF1\xF2\xF3\xF4 (4 bytes).
I think I need std::hex but I'm confused by the examples I saw. After the conversion I need to access those bytes (as a char array) so that I can convert them to ASCII from EBCDIC (but that's another story).
So I think it would be something like this:
somevariable << std::hex << InputString; But what should I use as somevariable? By the way, the InputString can be any length from 1 to 50-something or so.
My compiler is g++ 4.8 on Linux.
[ 0xf1, 0xf2, 0xf3, 0xf4 ].