title: How to assign C++ array with a pointer to first element?
body: <p>I apologize that I am still very new with C++, so your patience is appreciated.</p>
  
  <p>As part of an un-alterable constraint in my project, I must convert a Vector to an Array. In my searching for a solution I have repeatedly come across answers like <a href="https://stackoverflow.com/a/2923290/2453459">this one</a>.</p>
  
  <p>As I understand, that solution gives you a pointer to the first element in the vector -- and since a vector is guaranteed to be contiguous in memory you can then set the array to point to that memory location (or something like that).</p>
  
  <p>My question is, though, <em>how exactly do I do that in C++?</em> The answer seems to suggest it is trivial, but I can't find how to do it.</p>
  
  <p>I have tried things of this nature but they don't work....</p>
  
  <pre><code>std::vector&lt;double&gt; v;
  double* a = &amp;v[0];
  double myArray[100];
  &amp;myArray[0] = a;
  </code></pre>
  
  <p><strong>Given a pointer to the first element in a sequence, how do I then use that pointer to 'populate' an array?</strong> Furthermore, do I have to worry about size differences/going out of bounds issues? Also, could I do this in reverse as well ('populate' a vector with a pointer to the first element of an array)?</p>