Skip to content

tuqingyun/c_plus_plus_tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

c_plus_plus_tools

demo for json.hpp

#include "json.hpp"
#include <string>
#include <iostream>
#include <fstream>
 
using namespace std;
using json = nlohmann::json;

int main(){
  json item;
  item["name"] = "name";
  item["name"]["cls"] = "cls";
  item["nothing"] = {"some", 123};
  json temp;
  temp["item"] = item;
  
  string jsonFile = "demo.json";
  ofstream outFile(jsonFile);
  outFile << setw(4) << temp << endl;
  cout << item.dump(4) << endl;
  return 0;
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages