You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am trying to create a nested json array (the number or layers may vary depending on the input stream)
After some pre processing: This is my expected input and output
Sample data:
Keys: {a,b,c} Value: "Hi"
Keys: {a,b,d} Value: "Hi",
Expected Outcome: {"a":{"b":{"c":"Hi","d":"Hi"}}}
Current Outcome: [{"a":{"b":{"c":"Hi"}}},{"a":{"b":{"d":"Hi"}}}] //created 2 objects instead of one
Hi, I am trying to create a nested json array (the number or layers may vary depending on the input stream)
After some pre processing: This is my expected input and output
Sample data:
Keys: {a,b,c} Value: "Hi"
Keys: {a,b,d} Value: "Hi",
Expected Outcome: {"a":{"b":{"c":"Hi","d":"Hi"}}}
Current Outcome: [{"a":{"b":{"c":"Hi"}}},{"a":{"b":{"d":"Hi"}}}] //created 2 objects instead of one
My Code:
Sorry, I am new to C++, and this code is just a test code I wrote to see if I am able to achieve this in C++.
Thank you in advance.
The text was updated successfully, but these errors were encountered: