Skip to content
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

Reading a JSON file into a JSON object #351

Closed
AbdallaGomaa7 opened this issue Nov 2, 2016 · 2 comments
Closed

Reading a JSON file into a JSON object #351

AbdallaGomaa7 opened this issue Nov 2, 2016 · 2 comments

Comments

@AbdallaGomaa7
Copy link

Hey, I am trying to read a json file into a json object, what is the best way to do this?

@AbdallaGomaa7 AbdallaGomaa7 changed the title Reading a JSON file intoa JSON objec Reading a JSON file intoa JSON object Nov 2, 2016
@AbdallaGomaa7 AbdallaGomaa7 changed the title Reading a JSON file intoa JSON object Reading a JSON file into a JSON object Nov 2, 2016
@nlohmann
Copy link
Owner

nlohmann commented Nov 2, 2016

You can do it like this:

std::ifstream my_file("file.json");
json j;
j << my_file;

@nlohmann
Copy link
Owner

nlohmann commented Nov 8, 2016

@AbdallaGomaa7, can this issue be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants