0

I parse json in C, by "json-c/json.h".

I have structure: section: [ {item: {...}, item: {...}, ..., item: {...}} ]

I can get 1 item by:

struct json_object item = json_object_object_get(section, "item");

How I can get count of items, and parse all items?

  • I have big `typedef struct` for storage each item. And me need allocated array of items, before parse them. – pd278115 Oct 11 '18 at 04:36
  • Is that really your correct string? The JSON array seems a bit weird. I would expect something more like `section: [{item: {...}}, {item: {...}},... {item: {...}}]` – Gerhardh Oct 11 '18 at 05:44
  • I know about, what must seems json. It's simply example for what i mean, not for discussion about example. – pd278115 Oct 11 '18 at 09:03

0 Answers0