Read basic values from an array¶
Example on how to read basic values from an array.
We have this json:¶
[
"avocados",
"red beans",
"hazelnuts",
"flour",
"onion powder"
]
C++:¶
Json json;
json.Parse(aboveJsonCode);
for (unsigned int i = 0; i < json.AsArray.Size(); i++)
{
std::string myString = json.AsArray[i].AsString;
std::cout << myString << std::endl;
}
That's it.