title: How to copy std::string into std::vector<char>?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/8247793/converting-stdstring-to-stdvectorchar">Converting std::string to std::vector&lt;char&gt;</a>  </p>
  </blockquote>
  
  
  
  <p>I tried:</p>
  
  <pre><code>std::string str = "hello";
  std::vector&lt;char&gt; data;
  std::copy(str.c_str(), str.c_str()+str.length(), data);
  </code></pre>
  
  <p>but it does not work=( So I wonder How to copy <code>std::string</code> into <code>std::vector&lt;char&gt;</code> or <code>std::vector&lt;uchar&gt;</code> ?</p>