I have a json file that looks like this:
{
"type": "2D",
"data":
[
[
"26",
"17",
"1"
],
[
"13",
"29",
"1"
],
[
"13",
"30",
"1"
],
....
In data, each array have a meaning so I need to assign a variable to each one (in a loop), like:
int first = 26;
int second = 17;
int third = 1;
I was doing something like this (I defined before v):
BOOST_FOREACH(boost::property_tree::ptree::value_type &v2, v.second.get_child("data")) {
BOOST_FOREACH (boost::property_tree::ptree::value_type& itemPair, v2.second) {
cout << itemPair.second.get_value<std::string>() << " ";
}
}
}
Just to print each variable, but I handle only to have them as a set, not each one. Does anyone have an idea how to do it?
thanks in advance!