title: const char * to vector<unsigned char> Initalisation
body: <p>I understand that using vector is a good way to store binary data when using C++ and the STL. However for my unit tests I'd like to initalise the vector using a const char* C string variable.</p>
  
  <p>I'm attempting to use a variant of the code found here - <a href="https://stackoverflow.com/questions/725040/converting-void-to-stdvectorunsigned-char">Converting (void*) to std::vector&lt;unsigned char&gt;</a> - to do this:</p>
  
  <pre><code>const char* testdata = "the quick brown fox jumps over the lazy dog.";
  
  unsigned char* buffer = (unsigned char*)testdata;
  typedef vector&lt;unsigned char&gt; bufferType;
  
  bufferType::size_type size = strlen((const char*)buffer);
  bufferType vec(buffer, size);
  </code></pre>
  
  <p>However the VC++ compiler is not happy with the line initialising the vector, stating:</p>
  
  <pre><code>error C2664: 'std::vector&lt;_Ty&gt;::vector(unsigned int,const _Ty &amp;)' : cannot convert parameter 1 from 'char *' to 'unsigned int'
  </code></pre>
  
  <p>I appreciate the extreme n00bity of this question and am fully prepared for much criticism on the code above :)</p>
  
  <p>Thanks in advance,
  Chris</p>