Difference between std::string(size, '\0') and s.resize(size)?
<p>Unlike std::vector, std::string does not provide a unary constructor that takes a size:</p>

<pre><code>std::string s(size); // ERROR
</code></pre>

<p>Is there any difference between:</p>

<pre><code>std::string s(size, '\0');
</code></pre>

<p>and</p>

<pre><code>std::string s;
s.resize(size);
</code></pre>

<p>in terms of their performance on common implementations?</p>

<p>Will resize initialize the string to all zero characters or will it leave them an unspecified value?</p>

<p>If all zero, is there any way to construct a string of a given size, but leave the characters with an unspecified value?</p>