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

Commented Unassigned: How do I access data by name? [339]

$
0
0
How can I access data by name instead of having to do string processing? Attached please find my code to parse the json.

Comments: Ah yes I forgot, this will just return a json::value type. If you know it is a string you can use the [json::value::as_string()](http://microsoft.github.io/cpprestsdk/classweb_1_1json_1_1value.html#ad3416dd57e92d8660d4d938ef5a58960) function. There also are other functions to integrating with the C++ type system like as_integer(), as_double(), as_bool(), etc... So it would look something like the following: string_t str = myArray[0].as_string();

Viewing all articles
Browse latest Browse all 4845

Trending Articles



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