美文网首页
cpp解析json

cpp解析json

作者: heliping_peter | 来源:发表于2024-06-02 09:17 被阅读0次
#include "libs/json.h"

using json = nlohmann::json;

 std::ifstream file("config/protodata.json");
    if (!file.is_open())
    {
        exit(1);
    }
    auto config_json = json::parse(file); 
    std::string name = config_json["name"];
    printf("get the json name: %s\n", name.c_str());

相关文章

网友评论

      本文标题:cpp解析json

      本文链接:https://www.haomeiwen.com/subject/jdtsqjtx.html