string temp;
temp = line.substr(0, pos);
I need to convert the string temp to an unsigned char array. Could someone please tell me how this can be done? I tried the methods mentioned in the below link but they didn't work.
How to convert a string literal to unsigned char array in visual c++
unsigned char* val=new[temp.size() + 1](); //Error: Expected a type.
copy(temp.begin(), temp.end(), val);
chararray you can use.c_str()but that doesn't guarantee unsigned. Why don't the methods in that other question work for you?unsigned chararray, right? Not just anunsigned char?"abcde", what should be the result?