I am using nlohmann/json lib and want to get the length of a json array. Image i have:
[
"test",
"test2"
]
and want to recieve the length (2). When i tried the .length() method, it showed me this error:
using json = using json = class nlohmann::basic_json<>' {aka 'class nlohmann::basic_json<>'} has no member named 'length
so how can I get the length in this library?
You want to use myJsonArray.size() method here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With