File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ And in your code
6969
7070const char * some_json_string = " {\" hello\" :\" world\" ,\" key\" :\" value\" }" ;
7171
72- int main (int argc, const char * argv [ ] ) {
72+ int main () {
7373 json_object_t * json = json_parse(some_json_string);
7474 printf ("Count: %i\n", json->count);
7575 printf ("Key: %s\nValue: %s", json->entries[ 0] .type, json->entries[ 0] .value.as_string);
@@ -91,10 +91,10 @@ Value: world
9191
9292const char * complex_json = " {\" name\" :{\" first\" :\" John\" ,\" last\" :\" Doe\" },\" age\" :21.5}" ;
9393
94- int main(int argc, const char * argv[] ) {
95- json_object *json = json_parse(complex_json);
96- json_object *name_json = json->entires[0].value.as_object;
97- printf("First name: %s\nLast name: %s\Age : %f",
94+ int main () {
95+ json_object_t * json = json_parse(complex_json);
96+ json_object_t * name_json = json->entires[ 0] .value.as_object;
97+ printf ("First name: %s\nLast name: %s\nAge : %f",
9898 name_json->entries[ 0] .value.as_string,
9999 name_json->entries[ 1] .value.as_string,
100100 json->entries[ 1] .value.as_number);
You can’t perform that action at this time.
0 commit comments