title: C++ convert int and string to char*
body: <p>This is a little hard I can't figure it out.</p>
  
  <p>I have an int and a string that I need to store it as a char*, the int must be in hex</p>
  
  <p>i.e.</p>
  
  <pre><code>int a = 31;
  string str = "a number";
  </code></pre>
  
  <p>I need to put both separate by a tab into a char*.</p>
  
  <p>Output should be like this:</p>
  
  <pre><code>1F      a number
  </code></pre>