How to repeat a string a variable number of times in C++?
<p>I want to insert 'n' spaces (or any string) at the beginning of a string in C++. Is there any direct way to do this using either std::strings or char* strings?</p>

<p>E.g. in Python you could simply do</p>

<pre><code>&gt;&gt;&gt; "." * 5 + "lolcat"
'.....lolcat'
</code></pre>
