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.
here is a code snippet that shows the problem:
QString test = "hello";
unsigned char* test1 = (unsigned char*) test.data();
unsigned char test2[10];
memcpy(test2,test1,test.size());
std::cout<<test2;
I try to fit the QString into the unsigned char array but the output I get is always just 'h'.
Can anyone tell me what is going wrong here?