1

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?

1 Answer 1

0

I resolved this, it's not an issue because just console output has a omitted string. If I make a file(ofstream) from the json string, all values are printed well.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.