から値を変更したい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);