title: Convert QString into unsigned char array
body: <p>I have a very basic question here. I tried googling for a while, because there are a lot of similar questions but none of the solutions worked for me.</p>
  
  <p>here is a code snippet that shows the problem:</p>
  
  <pre><code>QString test = "hello";
  unsigned char* test1 = (unsigned char*) test.data();
  unsigned char test2[10];
  memcpy(test2,test1,test.size());
  std::cout&lt;&lt;test2;
  </code></pre>
  
  <p>I try to fit the QString into the unsigned char array but 
  the output I get is always just 'h'.</p>
  
  <p>Can anyone tell me what is going wrong here?</p>