我想将值从slotList
.
slotList[1][1] = "1234";
我怎么解决这个问题?
这是我尝试过的:
JSON:
{
"slotList" : [
[ "1452", "1452", "1452", "1452", "1452" ],
[ "1452", "1452", "1452", "1452", "1452" ],
[ "1452", "1452", "1452", "1452", "1452" ],
[ "1452", "1452", "1452", "1452", "1452" ],
[ "1452", "1452", "1452", "1452", "1452" ]
]
}
代码:
if (bIsParsed == true)
{
Json::Value slotList = root["slotList"];
Json::Value slot = slotList[currentIndex];
Json::Value value = "111"; // what is wrong? do not change anything! OMG!
slot[selectIndex].swap(value);
}
Json::StyledWriter writer;
string jsonData = writer.write(root);