title: string conversion to const char * problems
body: <p>I have this problem that whenever I try to send my post_data1 by libcurls http post it says wrong password, but when I use the fixed expression in post_data2 it logs me in. And when I cout both they are the exact same string.. </p>
  
  <p>Can anyone tell me why they are not the same when libcurl put them in the header? Or why they differ before I send them if that is the case. </p>
  
  <pre><code>string username = "mads"; string password = "123"; 
  stringstream tmp_s;
  tmp_s &lt;&lt; "username=" &lt;&lt; username &lt;&lt; "&amp;password=" &lt;&lt; password;
  static const char * post_data1 = tmp_s.str().c_str();
  static const char * post_data2 = "username=mads&amp;password=123";
  
  std::cout &lt;&lt; post_data1 &lt;&lt; std::endl;  // gives username=mads&amp;password=123
  std::cout &lt;&lt; post_data2 &lt;&lt; std::endl;  // gives username=mads&amp;password=123
  
  // Fill postfields
  curl_easy_setopt(curl, CURLOPT_POSTFIELDS, post_data1);
  
  // Perform the request, res will get the return code
  res = curl_easy_perform(curl);
  </code></pre>