Json: How do I count number of objects in array?

Created on 17 Jun 2018  路  2Comments  路  Source: nlohmann/json

Hi. I wanna count number of objects in array. For example: jsonObj["array"] is object that store another objects. I can access them by jsonObj["array"][0]["something"], jsonObj["array"][1]["something"], jsonObj["array"][2]["something"], and so on. So how do I count number of objects in jsonObj["array"]?

Thank you. :)

question proposed fix

Most helpful comment

How about size()?

All 2 comments

How about size()?

Oh yeah... Sorry. I'm blind eh.

Was this page helpful?
0 / 5 - 0 ratings