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

JQuery Autocomplete without using label, value, id -

c++ - Accessing inactive union member and undefined behavior? -

JAVA - what is the difference between void and boolean methods? -