title: Most efficient way to use strcat() with a string and int?
body: <p>I'm try to concatenate to <code>char * rv</code> with the result of a function call that will return an <code>int</code>. <code>fib()</code> returns an int. The main problem I'm running into is that <code>strcat()</code>'s signature requires a <code>const char *</code> as it's second arg:</p>
  
  <pre><code>char * strcat ( char * destination, const char * source );
  </code></pre>
  
  <p>Here is a small sample of my code. <code>fib()</code> calculates the nth fibonacci number - in this case, the 7th fibonacci number.</p>
  
  <pre><code>char * rv;
  int num;
  
  rv = (char*)malloc(2048*sizeof(char));
  num = 7;
  
  ...
  
  strcat(rv, (const char *)itoa(fib(num), rv,10));
  </code></pre>
  
  <p>Obviously this is wrong and won't compile. What is the cleanest way to do this? Do I need another <code>char * var</code> to store the results of <code>itoa()</code> first, instead of using <code>rv</code>?</p>
  
  <p>Thank you for any help you can provide!</p>