c++ - Why isn't the JSON object an array? -


my json file looks this:

{ "strings": { "keyone": "abc", "keytwo": "def", } } 

using c++,

const json::value strings = root["strings"]; (int index = 0; index < strings.size(); index++) { std::cout << strings.isarray() << std::endl; std::cout << strings.get(index, "error") << std::endl; } 

strings.isarray() returns 0, saying it's not array. , second line strings.get(index, "error)", crashes when executing, because i'm using array when it's not.

so i'm assuming strings string , not array. how can make array object?

"strings.isarray()" returns 0, saying it's not array

of course does, "strings":{ ... } "object" in json terms.


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -