title: How to deallocate memory for const std::vector<unsigned char>
body: <p>I am using one library api which returns  const std::vector . Below is the code</p>
  
  <pre><code>const std::vector&lt;unsigned char&gt; myvar = getData();
  </code></pre>
  
  <p>Now i have cleanup memory for myvar. How to do this with c++.</p>
  
  <p>I am trying something like</p>
  
  <pre><code>std::for_each(myvar.begin(), myvar.end(), [&amp;](unsigned char mychar)
  {
      cout&lt;&lt;mychar&lt;&lt;",";
  
  
      delete &amp;mychar;
  
  });
  </code></pre>
  
  <p>But failing with the heap curruption.</p>
  
  <p>Thanks for the input.</p>