title: How much performance difference when using string vs char array?
body: <p>I have the following code:</p>
  
  <pre><code>char fname[255] = {0}
  snprintf(fname, 255, "%s_test_no.%d.txt", baseLocation, i);
  </code></pre>
  
  <p>vs</p>
  
  <pre><code>std::string fname = baseLocation + "_test_no." + std::to_string(i) + ".txt";
  </code></pre>
  
  <p>Which one performs better? Does the second one involve temporary creation? Is there any better way to do this?</p>