how to convert std::vector<vector> to void*
<p>I am wondering how can I convert <code>std::vector&lt;vector&gt;</code> to <code>void*</code>, for example:</p>
<pre><code>std::vector&lt;ColorData&gt; pixels_ (w*h, background_color);
</code></pre>
<p>Now I want to convert <code>pixels_</code> to <code>void*</code> so that I can <code>memcpy</code> the <code>pixels_</code>.</p>
<pre><code>memcpy ((void*)destinationBuffer-&gt;pixels_, (void*)sourceBuffer-&gt;pixels_, \
sizeof(ColorData)*destinationBuffer-&gt;width_*destinationBuffer-&gt;height_);
 
</code></pre>
<p>But when I run this code, I get an error which says:</p>
<blockquote>
<p>invalid cast from type ‘std::vector&lt;image_tools::ColorData&gt;’ to type ‘void*’</p>
</blockquote>
<p>How can I convert <code>std::vector&lt;vector&gt;</code> to <code>void*</code>?</p>