We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I'm trying to run compiled application with simple parse code it fails with an exception:
[json.exception.parse_error.101] parse error at 73: syntax error - unexpected '}'; expected string literal
Code:
int main() { std::ifstream file("test.json"); std::stringstream buffer; buffer << file.rdbuf(); json config; try { config = json::parse(buffer); } catch (const json::exception& e) { std::cout << "Loading error: " << e.what() << "\n"; exit(-1); } try { std::cout << "Name: " << config["name"] << "\n"; } catch (const json::exception& e) { std::cout << "Couldnt parse: " << e.what() << "\n"; exit(-1); } return 0; }
JSON file is indeed valid:
{ "pi": 3.141, "happy": true, "name": "Niels", "nothing": null, }
Compiler:
Thread model: win32 gcc version 6.3.0 (MinGW.org GCC-6.3.0-1)
Bug or something I'm doing wrong?
The text was updated successfully, but these errors were encountered:
As the error says, the JSON file is invalid. You have a comma after null which doesn't belong.
null
Sorry, something went wrong.
Oh right. Been tired. Thanks.
No branches or pull requests
When I'm trying to run compiled application with simple parse code it fails with an exception:
Code:
JSON file is indeed valid:
Compiler:
Thread model: win32
gcc version 6.3.0 (MinGW.org GCC-6.3.0-1)
Bug or something I'm doing wrong?
The text was updated successfully, but these errors were encountered: