c/c++使用json
来源:互联网 发布:注册账号的软件 编辑:程序博客网 时间:2024/05/17 00:14
1. JSON_parser 只是对json语法的解析, 是基于sax的. 用于学习挺好的.
2. mjson 同时有dom和sax的完整解析方案, 很不错.
3. tinyjson是基于boost库的解析器, 用于学习挺好的.
4. json-c使用autoconfig兼容性最好,移植是个问题.
最后选择mjson.
修改json.h
//#include <stdint.h>
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
例子(好像部分有问题):
http://mjson.sourceforge.net/examples.html
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
#include "json.h"
int _tmain(int argc, _TCHAR* argv[])
{
setlocale (LC_ALL, "");
char *document = "{/"entry/":{/"name/":/"Andew/",/"phone/":/"555 123 456/"}}";
json_t *root = NULL;
printf("Parsing the document.../n");
json_parse_document(&root, document);
printf("Printing the document tree.../n");
json_tree_to_string(root, &document);
printf("%s/n", document);
json_free_value(&root);
free(document);
return EXIT_SUCCESS;
}
- c使用json-c库
- c使用json-c库
- c/c++使用json
- json-C使用小结
- Objective-C Json 使用
- C 使用libcurl与json-c方法
- C 使用libcurl与json-c方法
- JSON C库的使用
- json-c 0.12 使用介绍
- JSON-C结构介绍、使用
- json-c库使用总结
- json-c库使用总结
- C++json文件的使用
- c语言json的使用
- C++->json
- JSON C
- json c
- JSON-C
- asp.net主题概述
- 要找工作咯,我的简历
- web工程在tomcat下的部署
- 游泳
- [双语阅读]英国工会:工作场所应对高跟鞋说“不”
- c/c++使用json
- struts的ActionForm获取中文乱码问题的解决办法
- 什么词儿让你很不爽?
- 短信诈骗 smishing
- 游戏“插件” add-on
- [双语阅读]经济危机致原料短缺 古巴厕纸告急
- SQL Server 2005 安装 COM+ 错误解决
- bite one's lip 保持沉默
- [英语阅读]英国进行首例睫毛移植手术