C++: Reading a json object from file with nlohmann json
Update 2017-07-03 for JSON for Modern C++ version 3 Since version 3.0, json::json(std::ifstream&) is deprecated. One should use json::parse() instead: std::ifstream ifs(“test.json”); json jf = json::parse(ifs); std::string str(R”({“json”: “beta”})”); json js = json::parse(str); For more basic information on how to use nlohmann’s json library, see nlohmann FAQ. Update for JSON for Modern C++ version 2 … Read more