JSON-C is there a way to use json_object_object_add to add to the beginning of an object that is already populated?

96 Views Asked by At

I am working with JSON-C in C to add to an object.

Is there a way to use json_object_object_add to add to an existing object but at the beginning of the object?

Example:

json_object * jobj = json_object_new_object();
json_object_object_add(jobj,"Key 2", json_object_new_string("value 2"));

//put this at the top as first element
json_object_object_add(jobj,"Key 1", json_object_new_string("value 1")); 
0

There are 0 best solutions below