adding int to char array in C
<p>I'm trying to parse assembly commands, and there's a certain case I need to generate a random number and add that to a char array.
Example:</p>

<pre><code>mov #(random number), r0
</code></pre>

<p>I have <code>char* srcOp</code> </p>

<p>Now I tried doing something like that:</p>

<pre><code>int i;
time_t t;

srand((unsigned) time(&amp;t));
i = rand() % 100;
(*srcOp)='#';
// append here i to srcOp . Supopse i is 39 -&gt; srcOp should contain '#39'
</code></pre>

<p>and now I need to append the value of '<code>i</code>' to srcOp, but I either get a runtime error or a compilation error.</p>