我正在尝试制作一个使用来自网站的 Json 的程序,但我似乎遇到了这个问题:
std::ifstream ifile("json.txt");
Json::Reader reader;
Json::Value root;
if (ifile != NULL && reader.parse(ifile, root)) {
const Json::Value arrayDest = root["dest"];
for (unsigned int i = 0; i < arrayDest.size(); i++) {
if (!arrayDest[i].isMember("name"))
continue;
std::string out;
out = arrayDest[i]["name"].asString();
std::cout << out << "\n";
}
}
我已将问题范围缩小到该行
Json::Reader reader;
它给了我一个错误:
调试断言... _pFirstBlock == pHead
我正在使用 jsoncpp