Json::Value root;
Json::Value arrayObj;
Json::Value item;
for (int i=0; i<10; i++)
{
item["key"] = i;
item["value"] = 10*i;
arrayObj.append(item);
}

root["key1"] = "value1";
root["key2"] = "value2";
root["array"] = arrayObj;
root.toStyledString();
std::string out = root.toStyledString();
std::cout << out << std::endl;

相关文章:

  • 2022-12-23
  • 2021-10-02
  • 2021-10-22
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
  • 2021-07-24
  • 2022-12-23
猜你喜欢
  • 2021-12-06
  • 2021-09-04
  • 2022-02-10
  • 2022-12-23
  • 2022-02-24
  • 2021-10-12
相关资源
相似解决方案