 <p>In this specific case, it is going to work because the string in <code>buffer</code> will be the first thing that is going to enter in <code>buffer</code> (again, useless), so you should use <code>strcat()</code> instead to get the [almost] same effect.</p> <p>But, if you are trying to combine <code>strcat()</code> with the formating possibilities of <code>sprintf()</code>, you may try this:</p> <pre><code>sprintf(&buffer[strlen(buffer)], " &lt;input type='file' name='%s' /&gt;\r\n", id);</code></pre>