I am getting image data from POST API using cpprestsdk in form of vector and then I am trying to convert it into unsigned char pointer for further processing.
Below is my code and it is working properly in ubuntu but in windows, the data is getting corrupted and as a result, I am not able to process image further.
string image_name = (string)http_get_vars["name"];
int len;
unsigned char *image_data = NULL;
//reading binary data and storing it in a pointer
request.extract_vector().then([image_name, &image_data, &len](vector<unsigned char> v) {
utility::string_t ustring = {v.begin(),v.end()};
image_data = (unsigned char *)ustring.c_str();
len = ustring.size();
}).wait();