#include <iostream>
      #include <nlohmann/json.hpp>
      #include <iomanip>
      #include <vector>
      #include <fstream>
      
      using json = nlohmann::json;
      int readJSON(){
        std::ifstream is("i_data.json");
        json i_data;
        is >> i_data;
        std::vector<std::string> ids = i_data["id"];
        std::vector<int> counts = i_data["count"];
        return 0;
      }
      
      Cpp language logo

      Read JSON

      Codiga's C++ Recipes

      Use nlohmann lib to read JSON

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.