You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm no expert but I think it can already do this?
// Create a new array to add our properties to
json_object* new_array = json_object_new_array();
json_object_object_add(current, type, new_array);
for each item in the array: {
for each property of each item: {
// Add a new element so that we can add a pair for the name and value
json_object* str_value = json_object_new_string(iter->second.c_str());
json_object* pair_object = json_object_new_object();
json_object_object_add(pair_object, iter->first.c_str(), str_value);
}
// Add the pair to the array
json_object_array_add(new_array, pair_object);
}
Hi,
Is it possible to add support for array of objects? Just like the following output:
myOtherArray = [
{
"first" : "John",
"last" : "Smith"
},
{
"first" : "Jane",
"last" : "Doe"
}
];
The text was updated successfully, but these errors were encountered: