Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all articles
Browse latest Browse all 4845

New Post: Is it possible to convert string_t to string?

$
0
0
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?

Viewing all articles
Browse latest Browse all 4845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>