title: How can I insert the content of arrays into a vector?
body: <p>I need to write some simple code with <code>std::vector</code>s and I am struggling a bit.</p>
  <p>I have a <code>char[]</code> buffer that is filled with callback data from another program. I need to append this data to the end of a vector - the whole buffer.</p>
  <pre class="lang-cpp prettyprint-override"><code>std::vector&lt;char&gt; vector; 
  
  // data comes from another program
  void callback(char buffer[], size_t size)
  {
      // copy buffer to the end of vector here   
  }
  </code></pre>
  <p>At the end the vector is supposed to contain continuous data from the buffer.</p>
  <p>Is there an effective way to do this without inserting element by element with a loop?</p>
  <pre class="lang-cpp prettyprint-override"><code>for (size_t i = 0; i &lt; size; ++i)
      vector.push_back(buffer[i]);
  </code></pre>