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: Ok so if this is your JSON value: ["time","sequence_number","v"] It is a array not an object. I think you have some confusion about the [JSON](http://json.org/) type in general. Arrays and objects are not the same thing so you can't look up elements in an array by a string key. An object is a collection of string value pairs. A array is a collection of values. For an array you can access a value by indexing if you don't want to iterate: const t & = myArray[0]; Steve

Viewing all articles
Browse latest Browse all 4845

Trending Articles



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