Is it possible to parse only one JSON key/field/property in programming language C -


is possible c program 'read' (by using c json parser) 1 property of json object stored in char[]? want read 1 strig field of json object, because need know value decide kind of struct deserialize whole json object.

i have tried deserialize json objects containing int , double types. deserialize them 'predefined' struct having such declaration example:

struct obj{     int a;     int b;     double c; }; 

but want use 2 different structs example:

struct obj1{     int a;     char b[40];     double c;     char d[15]; };  struct obj2{     int a;     struct in b;     double c;     char d[15]; };  struct in1{    int ina;    int inb;    char inc[20]; }; 

which structure use deserialize json object determined value of 'string' char d[15]. , before deserializing json need know value.

the json string like:

{"a":"...", "c":"pure string or object", "c":"...", "d":"info type"} 

i confused because think c json parsers uncapable of doing because not object oriented.

yes, possible.

most of available c json parsers provide 'standart' c struct, describing single json value (key, property , on...). if make variable of type, possible parse('read') single value json object , manipulate or use value.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

css - Can I use the :after pseudo-element on an input field? -