1. 概述:
该demo主要实现json配置文件的基本操作,解析
引用cJSON库的地址为:https://github.com/DaveGamble/cJSON
2. 测试:
/*
From : https://github.com/paiminlin/PM
From : https://blog.csdn.net/lpaim/article/details/115499334
Author : PaiMin.lin
Date : 2022.8.23
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include "cJSON.h"
#ifdef __cplusplus
extern "C"{
#endif
#define Democjson_MAIN_DEBUG
#ifdef Democjson_MAIN_DEBUG
void doit(char * text)
{
int i = 0, j = 0;
char * out = NULL;
cJSON * json = NULL;
json = cJSON_Parse