title: How to get std::vector pointer to the raw data?
body: <p>I'm trying to use <code>std::vector</code> as a <code>char</code> array.</p>
  
  <p>My function takes in a void pointer:</p>
  
  <pre><code>void process_data(const void *data);
  </code></pre>
  
  <p>Before I simply just used this code:</p>
  
  <pre><code>char something[] = "my data here";
  process_data(something);
  </code></pre>
  
  <p>Which worked as expected.</p>
  
  <p>But now I need the dynamicity of <code>std::vector</code>, so I tried this code instead:</p>
  
  <pre><code>vector&lt;char&gt; something;
  *cut*
  process_data(something);
  </code></pre>
  
  <p>The question is, how do I pass the char vector to my function so I can access the vector raw data (no matter which format it is – floats, etc.)?</p>
  
  <p>I tried this:</p>
  
  <pre><code>process_data(&amp;something);
  </code></pre>
  
  <p>And this:</p>
  
  <pre><code>process_data(&amp;something.begin());
  </code></pre>
  
  <p>But it returned a pointer to gibberish data, and the latter gave warning: <code>warning C4238: nonstandard extension used : class rvalue used as lvalue</code>.</p>