What I need to do is the following.
const char *arrayHex[4];
for( int i = 0; i < 5; i++ )
{
cin << uHex;
arrayHex[i] = uHex;
}
But I need the members of arrayHex to be hex escaped with \x. How might I go about doing that?
This was really vaguely worded, edit to fix(hopefully)
If the input is 41, I want the result when printed to be “A”, as if the value was “\x41”
Note that I’m printing the exact same output both ways: with cout or with printf(). Personally I like printf() not because that’s what I learned first, but because printf() formatted output is significantly more expressive (for MOST built-in types) with less verbosity than cout, even though cout is more flexible because you can create cout output functions for user-defined types. But if your compiler doesn’t do printf()/scanf() format-parameter type checking (GCC does, if you enable it), then you can easily create some interesting & confusing output with mismatched types, and create nice non-deterministic SEGV generators quite easily by specifying less args than your format string indicates.