reading/writing nested objects #3434
Answered
by
falbrechtskirchinger
mohammedalasmar
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
falbrechtskirchinger
Apr 10, 2022
Replies: 1 comment 3 replies
-
I believe the examples section in the README covers everything you're asking: |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
nlohmann
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
json
, the default template instantiation ofbasic_json
, uses the STL comtainersstd::map
for objects andstd::vector
for arrays. You can access elements accordingly. For instance:int dataRate = rcvdJSON["master"]["configs"]["mIkjdfuehnduen"]["dataRate"];
I believe the examples section in the README covers everything you're asking:
https://github.com/nlohmann/json#examples