title: How can i copy elements in list to an array c/c++
body: <p>I have a list like:</p>
  
  <pre><code>list &lt;char&gt;mylist
  </code></pre>
  
  <p>I give it some elements</p>
  
  <pre><code>for (int i = 0; i &lt; 10; i++)
  {
      mylist.push_back(i);
  }
  </code></pre>
  
  <p>My questtion is that if there is anyway to copy those elements from list to an array like </p>
  
  <pre><code>char A[10];
  </code></pre>
  
  <p>static array 
  or</p>
  
  <pre><code>char *A= new char[10]; 
  </code></pre>
  
  <p>dynamic array </p>