title: If I'm able to printf an array index with %x, how do I then save it into a string?
body: <p>I see in the code I've inherited that the previous programmer <code>printf</code>s an array index out using %x. However, if I just try to append that same array index to a string with <code>+=</code> the string ends up being a bunch of symbols.</p>
  
  <p>How do I append a variable that can be accessed with %x to the end of a string?</p>
  
  <pre><code>printf("%x", array[i]);
  </code></pre>
  
  <p>Is what the outputting code looks like.</p>
  
  <p>But if I try:</p>
  
  <pre><code>string s = "";
  s += array[0];
  </code></pre>
  
  <p>It just adds a weird symbol.</p>