先看json的資料結構
c中沒有對象,所以json資料是採用鏈表格儲存體的
C代碼 typedef struct cJSON { struct cJSON *next,*prev; // 數組 對象資料中用到 struct cJSON *child; // 數組 和對象中指向子數組對象或值 int type; // 元素的類型,如是對象還是數組 char *valuestring; // 如果是字串 int valueint; // 如果是數值 double valuedouble; // 如果類型是cJSON_Number char *string; // The item's name string, if this item is the child of, or is in the list of subitems of an object. } cJSON;