This repository has been archived by the owner on Jul 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 173
How to get array on top of valid JSON #32
Comments
|
Ok, but how can i parse it? I get a string like in my first comment. Object o;
o.parse(json)); And now?
|
use "Array o;" instead. the json you are providing is not an Object, rather than an Array. |
Thank you man! :D #include <iostream>
#include <jsonxx/jsonxx.h>
using namespace std;
using namespace jsonxx;
int main() {
std::string json_str(
"[ "
" \"var1\", "
" { \"id\" : \"1234\" }, "
" \"var2\", "
" \"var3\" "
"] "
);
Array json;
json.parse(json_str);
cout << json.get<String>(0) << endl;
return 0;
} |
: ) |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This is valid json data. But how can I get "var1" or "var2"?
The text was updated successfully, but these errors were encountered: