cjson
杀鸡要用屠龙刀
努力成为未来AI消灭程序员的一份子
展开
-
cjson ---> 字符数组初始化
char text1[]="{\n\"name\": \"Jack (\\\"Bee\\\") Nimble\", \n\"format\": {\"type\": \"rect\", \n\"width\": 1920, \n\"height\": 1080, \n\"interlace\": false,\"frame rate\": 24\n}\n}"; char text2[]="[\"Sunday\", \"Monday\", \"Tuesday\", \"We原创 2020-07-30 18:27:18 · 311 阅读 · 0 评论 -
c/c++指针 ----> cJson源码阅读 day3-2
c 文件操作/* dofile("../../tests/test1"); */void dofile(char *filename){ FILE *f; long len; char *data; f = fopen(filename,"rb"); fseek(f,0,SEEK_END); len = ftell(f); fseek(f,0,SEEK_SET); data=(char*)malloc(len+1); fread原创 2020-07-30 18:20:38 · 107 阅读 · 0 评论 -
c/c++指针 ----> cJson源码阅读 day1
知识点1【指针】原创 2020-07-28 11:32:01 · 161 阅读 · 0 评论 -
c/c++指针 ----> cJson源码阅读 day3-1
- strcpy和memcpy的区别通常在复制字符串时用strcpy,而需要复制其他类型数据时则一般用memcpy原创 2020-07-30 17:29:07 · 198 阅读 · 0 评论 -
c/c++指针 ----> cJson源码阅读 day2-2
- parse_string函数(\"解析的难点)static const char *parse_string(cJSON *item,const char *str){ const char *ptr = str + 1; char *ptr2; char *out; int len = 0; unsigned uc,uc2; if (*str != '\"') // 非字符串 { ep = str; retur原创 2020-07-29 14:46:00 · 122 阅读 · 0 评论 -
c/c++指针 ----> cJson源码阅读 day2-1
- memset()函数/*memset库string.h中的函数.原型是 extern void *memset(void *buffer, int c, int n) buffer:为指针或是数组,c:是赋给buffer的值,n:是buffer的长度.将buffer中前 n 个字节用 c 替换并返回 buffer.*/static cJSON *cJSON_New_Item(void){ cJSON* node = (cJSON*)cJSON_malloc(sizeof(c原创 2020-07-29 14:37:28 · 132 阅读 · 0 评论