I have been trying unsuccessfully for several hours to figure out how to retrieve a string from within a json object stored within an array that has been retrieved from an api, and then store it in a plain old std::string. I tried simply attempting to assign to a std::string, but that didn't work, as it gave me a type mismatch error (utility::string_t does not match std::string).
I then attempted simply using a utility::string_t object to store the retrieved string, but attempting to use it with cout didn't work, even when using the c_str() conversion function. Using c_str() didn't result in any errors, but the output was junk.
Is there some easy conversion that I'm missing? Should I be trying something different?
I then attempted simply using a utility::string_t object to store the retrieved string, but attempting to use it with cout didn't work, even when using the c_str() conversion function. Using c_str() didn't result in any errors, but the output was junk.
Is there some easy conversion that I'm missing? Should I be trying something different?