I am trying to make a program that will use Json from a website and I seem to be having a problem with this:
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";
}
}
I have narrow down the issue to the line
Json::Reader reader;
and it giving me an error:
Debug assertion... _pFirstBlock == pHead
I'm using jsoncpp