Skip to content

Reading a JSON file into a JSON object #351

Closed

Description

@AbdallaGomaa7

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

Activity

  1. changed the title [-]Reading a JSON file intoa JSON objec[/-] [+]Reading a JSON file intoa JSON object[/+] on Nov 2, 2016
  2. changed the title [-]Reading a JSON file intoa JSON object[/-] [+]Reading a JSON file into a JSON object[/+] on Nov 2, 2016
  3. nlohmann commented on Nov 2, 2016

    @nlohmann
    Owner

    You can do it like this:

    std::ifstream my_file("file.json");
    json j;
    j << my_file;
  4. nlohmann commented on Nov 8, 2016

    @nlohmann
    Owner

    @AbdallaGomaa7, can this issue be closed?

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions