title: Conversion from int to c-string (const char*) fails
body: <p>I fail to convert <code>int</code> to a c-string (<code>const char*</code>):  </p>
  
  <pre><code>int filenameIndex = 1;      
  stringstream temp_str;
  temp_str&lt;&lt;(fileNameIndex);
  const char* cstr2 = temp_str.str().c_str();    
  </code></pre>
  
  <p>There is no error but <code>cstr2</code> does not get the expected value. It is initialized with some address.</p>
  
  <p>What's wrong and how can I fix it?</p>