title: Reading String From Stdin
body: <p>I have this code that reads from <code>stdin</code> into a <code>char*</code>.   Is it possible to do this directly into a <code>std::string</code>?</p>
  
  <pre><code>int size = std::atoi(m_content_size);
  char* buffer;
  buffer = (char*)malloc(size);
  fread(buffer, 1, size, stdin);
  
  ...
  
  free(buffer);
  </code></pre>
  
  <p>I suppose I could do <code>std::string sBuffer(buffer)</code>, but I'm hoping there is a better alternative.</p>
  
  <p>Thank you.</p>