c++ sprintf's format how to transfer a var
<p>I want to tansfer a var to sprintf's format, but how to!</p>

<pre><code>char s[100];
int d = 4;
sprintf(s, "%4s", "abc"); // i want the var 'd' replace '4', but how.
cout &lt;&lt; s;
</code></pre>
