title: Convert bytes array to Hexadecimal String
body: <p>Here is a that I write for Print a byte array to hex String , but now I want to save them as std::string and use it later</p>
  
  <p>here is my code</p>
  
  <pre><code>typedef std::vector&lt;unsigned char&gt; bytes;
  void printBytes(const bytes &amp;in)
  {
      std::vector&lt;unsigned char&gt;::const_iterator from = in.begin();
      std::vector&lt;unsigned char&gt;::const_iterator to = in.end();
      for (; from != to; ++from) printf("%02X", *from);
  }
  </code></pre>
  
  <p>what can I do ?, I want to save it as a string not print(Show) in console window?
  any idea!</p>