I'm using https://github.com/nlohmann/json to load JSON file into my program.
At this moment, I'm loading it:
json jsonFile;
ifstream ifs("data/test.json");
ifs >> jsonFile;
// create JSON from stream
json j_complete(jsonFile);
And I have access to it via:
jsonFile["data"][X][Y] // X, Y are indexes
But I want to create vector from this - how can I do this?
Here is sample of this file:
{
"cols": [
"id",
"title",
"quantity",
"price"
],
"data": [
[
12,
"Guzman",
6,
"6.31"
],
[
2,
"..",
5,
"4.34"
],
[
3,
"Goldeniererere",
14,
"4.15"
]
]
}