title: How to store a char arrays text in a string?
body: <p>ref:c++ example code at bottom from <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms740120(v=vs.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/windows/desktop/ms740120(v=vs.85).aspx</a>
  I have a char array</p>
  
  <pre><code>char RecvBuf[1024];
  </code></pre>
  
  <p>which gets filled up on receiving UDP message.
  How do I store it in a std::string variable  like <code>string str;</code> so that I can return a string from my function?</p>