If I codded as
Json::Value root, arr;
arr.append(0);
arr.append(0);
arr.append(0);
root["array"] = arr;
The output was like as..
{
"array" : [ 0, 0 ]
}
The problem is that only two values are shown. I'd like to make it "array" : [ 0, 0, 0 ] even though they are all same.
For reference, in case they are different, the output would be well-printed.
Json::Value root, arr;
arr.append(0);
arr.append(1);
arr.append(2);
root["array"] = arr;
->
{
"array" : [ 0, 1, 2 ]
}
Is there any optimized logic to print same values in an array by jsoncpp library? And is there any solution how to print all values?