-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Closed
Labels
kind: questionstate: needs more infothe author of the issue needs to provide more detailsthe author of the issue needs to provide more detailsstate: stalethe issue has not been updated in a while and will be closed automatically soon unless it is updatedthe issue has not been updated in a while and will be closed automatically soon unless it is updated
Description
- Describe what you want to achieve.
I want to check which is the result of thejson::parseof a certain file. Whenever I compile and run I see that works if I try to access one field. On the other hand if in debug mode, it crashes in:
- Describe what you tried.
My simple script is:
#include "nlohmann/json.hpp"
#include <fstream>
#include <iostream>
using json = nlohmann::json;
int main()
{
std::ifstream myinput("dataset/CTA_Bay17.json");
auto j = json::parse(myinput);
// write prettified JSON to another file
std::cout << j["array"] << "\n";
}
And the JSON I am reading is:
{
"array": [
1,
2,
3
],
"boolean": true,
"color": "gold",
"null": null,
"number": 123,
"object": {
"a": "b",
"c": "d"
},
"string": "Hello World"
}
-
Describe which system (OS, compiler) you are using. Mac OS Catalina and LLDB
-
Describe which version of the library you are using (release version, develop branch).
Master branch
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind: questionstate: needs more infothe author of the issue needs to provide more detailsthe author of the issue needs to provide more detailsstate: stalethe issue has not been updated in a while and will be closed automatically soon unless it is updatedthe issue has not been updated in a while and will be closed automatically soon unless it is updated
