How to create a string using placeholder (%s) in c
<p>Normally we can use placeholder %s in printf(), fprintf() function. </p>

<p>I want to use placeholder to create a string using %s. Like that</p>

<pre><code> char fName[200] = "C:\\Users\\%s\\Desktop\\Result", getenv("USERNAME");

 // getenv() function will return current user name

 // The fName will be "C:\\Users\\Zobayer\\Desktop\\Result"
</code></pre>

<p>I know in c++ we can create it by stringstream</p>

<pre><code>std::stringstream ss;
ss &lt;&lt; "C:\\Users\\" &lt;&lt; getenv("USERNAME") &lt;&lt; "\\Desktop\\Result";
</code></pre>

<p>But In C how can i create this type of string ? Please help me.</p>

<p>And advance thanks from me.</p>