title: How do you convert a byte array to a hexadecimal string in C?
body: <p>I have:</p>
  
  <pre><code>uint8 buf[] = {0, 1, 10, 11};
  </code></pre>
  
  <p>I want to convert the byte array to a string such that I can print the string using printf:</p>
  
  <pre><code>printf("%s\n", str);
  </code></pre>
  
  <p>and get (the colons aren't necessary):</p>
  
  <pre><code>"00:01:0A:0B"
  </code></pre>
  
  <p>Any help would be greatly appreciated.</p>