I'm doing some code where i have i need to use rapidjson in order to get the json values
First I retrieve the info from the file
ifstream myReadFile;
myReadFile.open("results.txt");
string output;
if (myReadFile.is_open()) {
while (!myReadFile.eof()) {
myReadFile >> output;
}
}
myReadFile.close();
Example of results.txt:
[{"ID":1,"Name":"SomeName","Description":"Pub"}]
and then I use rapidjson to filter the information,
const char * json = output.c_str();
Document document;
document.Parse(json);
cout << document["ID"].GetInt(); //Error on the line
cout << document["Name"].GetString());
But i get this error: Debug Error! abort() has been called
Ideas?
Thank you for your time