title: converting a string to byte (unsigned char) array cpp
body: <p>having real trouble with this simple issue.
  I have a string like this:</p>
  
  <pre><code>std::string msg = "00 00 00 00 00 06 01 05 00 FF 00 00";
  </code></pre>
  
  <p>which i would like to:</p>
  
  <pre><code>unsigned char bbuffer[12] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x01, 0x05, 0x00, 0xFF, 0x00, 0x00 };
  </code></pre>
  
  <p>what is the way to do it? </p>