随笔分类 - JSON
摘要:下面,对my.json中grade和name的第一个元素进行修改 toObject()、toArray()都会开辟新内存,这是我们认为改了,但是没有生效的原因所在。即在新内存上改了之后,需重新赋回旧内存。 核心代码:三板斧【一路to过去】【改】【一路赋回】 // 获取根 { } QJsonObjec
阅读全文
摘要:官网:Releases · nlohmann/json (github.com) #include <iostream> #include "nlohmann/json.hpp" #include <fstream> using json = nlohmann::json; int main() {
阅读全文