title: Converting hex into a string using 'sprintf'
body: <p>I am trying to convert an array into hex and then put it into a string variable. In the following loop the printf works fine, but I can not use sprintf properly. How can I stuff the hex values into the array as ASCII?</p>
  
  <pre><code>static unsigned char  digest[16];
  static unsigned char hex_tmp[16];
  
  for (i = 0; i &lt; 16; i++) {
    printf("%02x",digest[i]);  &lt;--- WORKS
    sprintf(&amp;hex_tmp[i], "%02x", digest[i]);  &lt;--- DOES NOT WORK!
  }
  </code></pre>