Printing out a Jansson Array by way of printf(json_string_value(...json_array...))

1,040 views
Skip to first unread message

fallco...@gmail.com

unread,
May 1, 2013, 8:08:33 PM5/1/13
to jansso...@googlegroups.com

I have a Jansson array declared as a json_t *object as in json_t *array;

This array is populated, but when I attempt to print out the jansson array by way of printf(json_string_value(array)), all I get are null strings.

It seems json_string_value does not operate well on json arrays.

What could I be doing wrong?

ausi

rogerz

unread,
May 2, 2013, 12:34:37 AM5/2/13
to jansson-users
json_string_value() is used only for retrieving the value from a json_string_t object. 

If you want to print the content of a generic json_t object, You may try json_dumps() and its family functions.
Reply all
Reply to author
Forward
0 new messages