RapidJson是只需包含头文件就可以直接使用的第三方json解析库1.包含头文件#include "rapidjson/document.h" #include "rapidjson/stringbuffer.h" #include "rapidjson/writer.h" 2.声明一些变量Document doc; doc.SetObject(); Document::AllocatorType& alloc = doc.GetAllocator(); Value key(kStringType); Value value(kStringType); 3.添加节点与赋值key.SetString("name", alloc); value.SetString("kun775", alloc); doc.AddMember(key, value, alloc);4.数组Value array(rapidjson::kArrayType); Value
SaiKwan
其实,我是一个程序员