title: Convert an ASCII std::string to hex
body: <p>is there an easy way to convert an ASCII std::string to HEX? I don't want to convert it to a number, I only want to convert each ASCII character to it's HEX value. The output format should also be a std::string.
  i.e.: "TEST" would be "0x54 0x45 0x53 0x54" or some similar format.</p>
  
  <p>I found this solution, but maybe there is a better one (without string to int to string conversion):</p>
  
  <pre><code>std::string teststring = "TEST";
  std::stringstream hValStr;
  for (std::size_t i=0; i &lt; teststring.length(); i++)
  {
      int hValInt = (char)teststring[i];
      hValStr &lt;&lt; "0x" &lt;&lt; std::hex &lt;&lt; hValInt &lt;&lt; " ";
  }
  </code></pre>
  
  <p>Thanks,<br>
  /mspoerr</p>