Json::Value root;
...//root中写入数据

//方法一:转为格式化字符串,里面加了很多空格及换行符
string strJson1 = root.toStyledString();

//方法二:转为未格式化字符串,无多余空格及换行符
Json::FastWriter writer;
string strJson1 = writer.write(root);

相关文章:

  • 2021-12-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-31
  • 2022-12-23
  • 2021-10-18
猜你喜欢
  • 2021-10-02
  • 2022-12-23
  • 2021-11-17
相关资源
相似解决方案