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

Multiple arrays to vectors help #1888

Closed
flamendless opened this issue Jan 3, 2020 · 2 comments
Closed

Multiple arrays to vectors help #1888

flamendless opened this issue Jan 3, 2020 · 2 comments
Labels
kind: question state: needs more info the author of the issue needs to provide more details

Comments

@flamendless
Copy link

With this json

{
  {
    "name": "test", "author": "test", "index": 0
  },
  {
    "name": "test2", "author": "test2", "index": 1
  }
}

How do I parse that so I can get each sub-array (2 in this example) and store those to a std::vector?

Sent from my HUAWEI GR5 2017 using FastHub

@nlohmann
Copy link
Owner

nlohmann commented Jan 3, 2020

Is the question on parsing or accessing?

The above snippet is not valid JSON: the outer braces start an object, but there is no key.

@nlohmann nlohmann added kind: question state: needs more info the author of the issue needs to provide more details labels Jan 3, 2020
@flamendless
Copy link
Author

Oh my bad. Yeah the json is not valid, sorry (new to json format). Anyways i have managed to answer my question. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: question state: needs more info the author of the issue needs to provide more details
Projects
None yet
Development

No branches or pull requests

2 participants