假如你在学习C语言编程,并第一次接触json,那你很可能会看到这样一份资料:《JSON C语言开发指南》。
http://blog.csdn.net/w_ww_w/article/details/8295027
内容挺充实的,但刚开始,看过还是不懂。概念看了不少,却没有形成一个清晰的思路;看示例代码,不了解函数太多,看不懂。
还有,C语言中一个变量有一个确定的类型,知道一个变量的类型,也可以确定它的存储空间大小。然而json_object可以有名称/值的存储形式,数组(同类型有序集合)形式。值可以boolean、int、double、string以及object(嵌套)。
struct json_object*json_object_new_boolean(boolean b);// 创建个json_type_boolean值类型json对象
boolean json_object_get_boolean(struct json_object *obj);// 从json对象中boolean值类型得到boolean值
struct json_object* json_object_new_int(int i)
int json_object_get_int(struct json_object *this)
struct json_object* json_object_new_double(double d)
double json_object_get_doub