Jansson Array

72 views
Skip to first unread message

alloys meshack

unread,
Apr 18, 2013, 11:23:47 AM4/18/13
to jansso...@googlegroups.com
guys i have this object
"bizseats": ["8","7","9","10","11","12","13"],

how do i get the entire array and asign it to a normal C array say i have UCHAR mySeats[ ] ;

rogerz

unread,
Apr 18, 2013, 6:41:42 PM4/18/13
to jansso...@googlegroups.com
Not clear about what you exactly want for mySeats[]. It is array of UCHAR, but json is array of string which should be unpack to consr char *;

json_t *array = json_object_get(obj, "bizseats");
size_t i;

for (i = 0; i < json_array_size(array); i++) {
  char *str = json_array_get(array, i);
  ...
--
--
Jansson users mailing list
jansso...@googlegroups.com
http://groups.google.com/group/jansson-users
---
You received this message because you are subscribed to the Google Groups "Jansson users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jansson-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


--
rogerz
Reply all
Reply to author
Forward
0 new messages