C语言使用cJson库解析json
使用C语言解析json cjson库 cjson对象类型与结构体 cjson的几个常用接口 对cjson库进一步封装 调用测试案例 cjson库 在github或gitee上cjson,使用库中的 cJSON.c 与 cJSON.h 即可。 以下是我使用cjson的案例仅供参考。 我的cJosn使用案例 cjson对象类型与结构体 /* cJSON Types: */ #define cJSON_Invalid (0) #define cJSON_False (1 << 0) #define cJSON_True (1 << 1) #define cJSON_NULL (1 << 2) #define cJSON_Number (1 << 3) #define cJSON_String (1 << 4) #define cJSON_Array (1 << 5) #define cJSON_Object (1 << 6) #define cJSON_Raw (1 << 7) /* raw json */ /* The cJSON structure: */ typedef struct cJSON { /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize