-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
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
Problem when writing to file. #904
Comments
In your |
Yes you are right, this is no what I wanted. |
std::ofstream o("myoutfile.json");
o << j; See https://github.com/nlohmann/json#tofrom-streams-eg-files-string-streams for examples. |
Thank you very much, It helped me. I will look at the attached link. |
Bug Report
I'm trying to write json file to file. When I'm printing the json to the screen, I can see it created normally.
JSON example file:
I attempt to create the json file using this code sample:
What is the expected behavior?
Create json file
And what is the actual behavior instead?
I got this error:
[json.exception.parse_error.101] parse error at 1: syntax error - unexpected end of input; expected '[', '{', or a literal
Which compiler and operating system are you using? Is it a supported compiler?
I'm using GCC 5.4, Ubuntu 16.04.3 LTS
Did you use a released version of the library or the version from the
develop
branch?I used the latest release 3.0.1
The text was updated successfully, but these errors were encountered: