Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I count number of objects in array? #1137

Closed
zavodnyrichard opened this issue Jun 17, 2018 · 4 comments
Closed

How do I count number of objects in array? #1137

zavodnyrichard opened this issue Jun 17, 2018 · 4 comments
Labels
kind: question solution: proposed fix a fix for the issue has been proposed and waits for confirmation

Comments

@zavodnyrichard
Copy link

zavodnyrichard commented Jun 17, 2018

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. :)

@nlohmann
Copy link
Owner

How about size()?

@zavodnyrichard
Copy link
Author

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

@nlohmann nlohmann added kind: question solution: proposed fix a fix for the issue has been proposed and waits for confirmation labels Jun 17, 2018
@Sneirox
Copy link

Sneirox commented Nov 24, 2022

Size () - is not length of Array, it's just count of all elements in whole array

@nlohmann
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: question solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

No branches or pull requests

3 participants