title: C++ character concatenation with std::string behavior. Please explain this
body: <p>Here are some cases about c++ std::string which I couldn't understand.</p>
  
  <p>1.</p>
  
  <pre><code>string ans = ""+'a';
  cout &lt;&lt; ans &lt;&lt; endl; //Prints _string::copy
  </code></pre>
  
  <p>2.</p>
  
  <pre><code>string ans="";
  ans=ans+'a';
  cout &lt;&lt; ans &lt;&lt; endl; //Prints a
  </code></pre>
  
  <p>3.</p>
  
  <pre><code>string ans="";
  ans = ans + (5 + '0'); // Throws error
  </code></pre>
  
  <p>4.</p>
  
  <pre><code>string ans="";
  ans += (5 + '0'); //works
  </code></pre>
  
  <p>5.</p>
  
  <p>In a code, I had the line 
   <code>ans += to_string(q);</code>  q was a single digit integer. The program threw runtime error.</p>
  
  <p>Changed it to <code>ans+= (q+'0');</code> and the error got removed.</p>
  
  <p>Please help with clearing the idea.   </p>