That means I can safely use eitherunsigned x = *reinterpret_cast<const unsigned *>(HEX.c_str());
or the code you gave me earlier for the hex_to_int() function?
If by "safely" you mean taking care to ensure we don't read/copy more bytes than we've got or write to any location that we aren't sure we control, then yes, either approach will work. If you don't understand why, please feel free to ask (but state which part you don't understand!).
The hex_to_int() function that you came up with earlier in post #4 should use the result of a sizeof expression in the third argument of the memcpy() call. I mentioned that earlier, but I want to stress the safely qualification. You're not going to blow up your computer or anything but bugs caused by being "unsafe" in these areas are incredibly hard to track down.