title: C: converting a uint8 array to a string containing the hex representation of its bytes
body: <p>I have a <code>uint8</code> array:</p>
  
  <pre><code>int i = 0;
  uint8_t x[32];
  
  for (i = 0; i &lt; 32; i++) {
      x[i] = i*i;
      printf("x[%d]: %02X\n", i, x[i]);
  }
  </code></pre>
  
  <p>Here are the contents of the array:</p>
  
  <pre><code>x[0]: 0 00
  x[1]: 1 01
  x[2]: 4 04
  ...
  x[14]: 196 C4
  x[15]: 225 E1
  ...etc
  </code></pre>
  
  <p>I want to convert the <code>x</code> array to a <code>char</code> array that is equivalent to the full string representation of the byte array stored in <code>x</code>, which is: </p>
  
  <pre><code>00010409101924314051647990A9C4E10021446990B9E4114071A4D9104984C1
  </code></pre>
  
  <p>Basically, I want to do the programatic equivalent of</p>
  
  <pre><code>char hex[64] = "00010409101924314051647990A9C4E10021446990B9E4114071A4D9104984C1"
  </code></pre>
  
  <p>How can this be done in <code>C</code> programming language?</p>