title: How to convert a char array to a string?
body: <p>Converting a C++ <code>string</code> to a char array is pretty straightorward using the <code>c_str</code> function of string and then doing <code>strcpy</code>. However, how to do the opposite?</p>
  
  <p>I have a char array like: <code>char arr[ ] = "This is a test";</code> to be converted back to:
  <code>string str = "This is a test</code>.</p>