首页 > TAG信息列表 > nlohmann

Sword nlohmann::json的使用

#include <iostream> #include <string> #include<sstream> #include "json.hpp" // C++ 之 nlohmann::json 的使用 /* 知识补充: 1. nlohmann::json编译依赖于-std=c++11 */ // 初始化 void test1() { nlohmann::json obj1, obj2, obj3, obj4; co

c++11 json解析库json.hpp

地址 https://github.com/nlohmann/json  使用时,直接#include "json.hpp" 再using namespace nlohmann; string jsonStr = R"({"id": 1, "name":"vivo"})";//第2个参数是错误处理,第3个参数是不throw exceptionnlohmann::json jr = json::parse(j